fix sometimes also showing shorter matches

This commit is contained in:
Robin Appelman 2024-09-15 17:32:09 +02:00
commit 78475c1e72

View file

@ -100,6 +100,9 @@ impl Matcher {
if !log_match.pattern.is_empty() if !log_match.pattern.is_empty()
&& match_single(log_match.pattern, log.message.as_ref()) && match_single(log_match.pattern, log.message.as_ref())
{ {
if log_match.pattern_len() > best_length {
best_match = None;
}
best_length = log_match.pattern_len(); best_length = log_match.pattern_len();
best_match = Some(match best_match { best_match = Some(match best_match {
Some(MatchResult::Single(res)) => { Some(MatchResult::Single(res)) => {