File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -3183,14 +3183,6 @@ PHP_FUNCTION(mb_levenshtein)
3183
3183
Z_PARAM_STR_OR_NULL (enc_name )
3184
3184
ZEND_PARSE_PARAMETERS_END ();
3185
3185
3186
- if (ZSTR_LEN (string1 ) == 0 ) {
3187
- RETVAL_LONG (ZSTR_LEN (string2 ) * cost_ins );
3188
- }
3189
-
3190
- if (ZSTR_LEN (string2 ) == 0 ) {
3191
- RETVAL_LONG (ZSTR_LEN (string1 ) * cost_del );
3192
- }
3193
-
3194
3186
const mbfl_encoding * enc = php_mb_get_encoding (enc_name , 6 );
3195
3187
if (!enc ) {
3196
3188
RETURN_THROWS ();
@@ -3217,6 +3209,14 @@ PHP_FUNCTION(mb_levenshtein)
3217
3209
unsigned char * in_2 = (unsigned char * )ZSTR_VAL (string2 );
3218
3210
unsigned int state = 0 ;
3219
3211
3212
+ if (strlen_1 == 0 ) {
3213
+ RETVAL_LONG (strlen_2 * cost_ins );
3214
+ }
3215
+
3216
+ if (strlen_2 == 0 ) {
3217
+ RETVAL_LONG (strlen_1 * cost_ins );
3218
+ }
3219
+
3220
3220
zend_long c0 , c1 , c2 ;
3221
3221
3222
3222
p1 = safe_emalloc (strlen_1 + 1 , sizeof (zend_long ), 0 );
You can’t perform that action at this time.
0 commit comments