From ec1824d3c3e734a5718fa96e4b37fbd808bfc5c6 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 19 Jul 2017 20:18:47 +0200 Subject: [PATCH] Make non smart case full match better than smart case full match --- src/ranked_match.cc | 6 +++++- src/ranked_match.hh | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ranked_match.cc b/src/ranked_match.cc index 0a3ad5a1..2bfb8d8b 100644 --- a/src/ranked_match.cc +++ b/src/ranked_match.cc @@ -144,7 +144,11 @@ RankedMatch::RankedMatch(StringView candidate, StringView query, TestFunc func) { m_flags |= Flags::Prefix; if (query.length() == candidate.length()) - m_flags |= Flags::FullMatch; + { + m_flags |= Flags::SmartFullMatch; + if (candidate == query) + m_flags |= Flags::FullMatch; + } } } diff --git a/src/ranked_match.hh b/src/ranked_match.hh index 9d0e3b73..379b855d 100644 --- a/src/ranked_match.hh +++ b/src/ranked_match.hh @@ -42,7 +42,8 @@ private: Contiguous = 1 << 2, OnlyWordBoundary = 1 << 3, Prefix = 1 << 4, - FullMatch = 1 << 5, + SmartFullMatch = 1 << 5, + FullMatch = 1 << 6, }; friend constexpr bool with_bit_ops(Meta::Type) { return true; }