From c5b219171cbab489b01087a372e24e3a719f6299 Mon Sep 17 00:00:00 2001 From: kotontrion Date: Wed, 8 Jan 2025 11:52:45 +0100 Subject: apps: fix wrong penalty --- lib/apps/fuzzy.vala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/apps/fuzzy.vala') diff --git a/lib/apps/fuzzy.vala b/lib/apps/fuzzy.vala index 7745320..590112e 100644 --- a/lib/apps/fuzzy.vala +++ b/lib/apps/fuzzy.vala @@ -2,15 +2,15 @@ namespace AstalApps { private int fuzzy_match_string(string pattern, string str) { const int unmatched_letter_penalty = -1; int score = 100; + int not_found_score = -10; if (pattern.length == 0) return score; - if (str.length < pattern.length) return int.MIN; + if (str.length < pattern.length) return not_found_score; bool found = fuzzy_match_recurse(pattern, str, score, true, out score); score += unmatched_letter_penalty * (str.length - pattern.length); - if(!found) score = -10; - + if(!found) score = not_found_score; return score; } -- cgit v1.2.3