&& is already short-circuit evaluation
abusing ? : seems unnecessary if m_stops empty -> just return false then try find -> judge if the term can be found (result of find is not the end of m_stops)
This commit is contained in:
parent
758f468e3a
commit
5608a8f79c
@ -50,7 +50,7 @@ bool StopList::setFile(const string &filename)
|
||||
// faster than find() in this case.
|
||||
bool StopList::isStop(const string &term) const
|
||||
{
|
||||
return m_stops.empty() ? false : m_stops.find(term) != m_stops.end();
|
||||
return !m_stops.empty() && m_stops.find(term) != m_stops.end();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user