Skip to content

Commit 464e877

Browse files
committed
ext/standard: Use fast ZPP in levenshtein()
1 parent 1cc5591 commit 464e877

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎ext/standard/levenshtein.c‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,14 @@ PHP_FUNCTION(levenshtein)
8080
zend_long cost_rep = 1;
8181
zend_long cost_del = 1;
8282

83-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|lll", &string1, &string2, &cost_ins, &cost_rep, &cost_del) == FAILURE) {
84-
RETURN_THROWS();
85-
}
86-
83+
ZEND_PARSE_PARAMETERS_START(2, 5)
84+
Z_PARAM_STR(string1)
85+
Z_PARAM_STR(string2)
86+
Z_PARAM_OPTIONAL
87+
Z_PARAM_LONG(cost_ins)
88+
Z_PARAM_LONG(cost_rep)
89+
Z_PARAM_LONG(cost_del)
90+
ZEND_PARSE_PARAMETERS_END();
8791

8892
RETURN_LONG(reference_levdist(string1, string2, cost_ins, cost_rep, cost_del));
8993
}

0 commit comments

Comments
 (0)