Tweak RankedMatch::operator<
This commit is contained in:
parent
ab20e2e5eb
commit
53821be7cc
|
@ -87,10 +87,13 @@ RankedMatch::RankedMatch(StringView candidate, StringView query)
|
||||||
|
|
||||||
bool RankedMatch::operator<(const RankedMatch& other) const
|
bool RankedMatch::operator<(const RankedMatch& other) const
|
||||||
{
|
{
|
||||||
if (m_only_word_boundary or other.m_only_word_boundary)
|
if (m_only_word_boundary and other.m_only_word_boundary)
|
||||||
return m_only_word_boundary and other.m_only_word_boundary ?
|
{
|
||||||
m_word_boundary_match_count > other.m_word_boundary_match_count
|
if (m_word_boundary_match_count != other.m_word_boundary_match_count)
|
||||||
: m_only_word_boundary;
|
return m_word_boundary_match_count > other.m_word_boundary_match_count;
|
||||||
|
}
|
||||||
|
else if (m_only_word_boundary or other.m_only_word_boundary)
|
||||||
|
return m_only_word_boundary;
|
||||||
|
|
||||||
if (m_prefix != other.m_prefix)
|
if (m_prefix != other.m_prefix)
|
||||||
return m_prefix;
|
return m_prefix;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user