Skip to content

Commit 316303d

Browse files
authored
Exit early when a score of 100 is found (#56)
1 parent 9169444 commit 316303d

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.13.0
1+
0.13.1

src/py_abstraction.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,11 @@ static PyObject* extractOne(PyObject* /*self*/, PyObject* args, PyObject* keywds
890890
result_choice = py_match_choice;
891891
choice_key = py_choice;
892892
result_index = i;
893+
894+
if (score_cutoff > 100) {
895+
free_owner_list(inner_owner_list);
896+
break;
897+
}
893898
}
894899
free_owner_list(inner_owner_list);
895900
}
@@ -929,4 +934,4 @@ static PyMethodDef methods[] = {
929934
{NULL, NULL, 0, NULL}
930935
};
931936

932-
PY_INIT_MOD(cpp_impl, NULL, methods)
937+
PY_INIT_MOD(cpp_impl, NULL, methods)

src/rapidfuzz/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"""
44
__author__ = "Max Bachmann"
55
__license__ = "MIT"
6-
__version__ = "0.13.0"
6+
__version__ = "0.13.1"
77

88
from rapidfuzz import process, fuzz, utils# levenshtein

0 commit comments

Comments
 (0)