Make non smart case full match better than smart case full match

This commit is contained in:
Maxime Coste 2017-07-19 20:18:47 +02:00
parent 016a50f213
commit ec1824d3c3
2 changed files with 7 additions and 2 deletions

View File

@ -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;
}
}
}

View File

@ -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<Flags>) { return true; }