Cleanup fuzzymatch();

This commit is contained in:
speedie 2023-07-05 01:48:53 +02:00
parent 4135cbc0f2
commit c8e0d08302

View file

@ -39,10 +39,6 @@ void fuzzymatch(void) {
pidx = 0; // pointer pidx = 0; // pointer
sidx = eidx = -1; // start of match, end of match sidx = eidx = -1; // start of match, end of match
// fuzzy match pattern
if (matchregex(tx.text, it->text) && regex) {
eidx = i;
} else {
// walk through item text // walk through item text
for (i = 0; i < itext_len && (c = it->text[i]); i++) { for (i = 0; i < itext_len && (c = it->text[i]); i++) {
if (!fstrncmp(&tx.text[pidx], &c, 1)) { if (!fstrncmp(&tx.text[pidx], &c, 1)) {
@ -53,7 +49,9 @@ void fuzzymatch(void) {
eidx = i; eidx = i;
break; break;
} }
} } else if (matchregex(tx.text, it->text) && regex) {
eidx = i;
break;
} }
} }