Skip to content

Commit

Permalink
Matcher: Do not match strings containing only separators
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelSchneid3r committed Oct 15, 2024
1 parent 88d6a01 commit 3d7883a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util/matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ class MatcherPrivate
Match match(const QString &s) const
{
// Empty query is a 0 score (epsilon) match
if (tokens.isEmpty())
if (string.isEmpty())
return {0.};

// Do not match strings containing only separators
if (tokens.isEmpty())
return {-1.};

QStringList other_tokens = tokenize(s);

double matched_chars = 0;
Expand Down

0 comments on commit 3d7883a

Please sign in to comment.