diff --git a/indexer/classificator.cpp b/indexer/classificator.cpp index fff10dcd0b..f66acc8589 100644 --- a/indexer/classificator.cpp +++ b/indexer/classificator.cpp @@ -47,11 +47,10 @@ ClassifObject * ClassifObject::Find(string const & s) void ClassifObject::AddDrawRule(drule::Key const & k) { - for (size_t i = 0; i < m_drawRule.size(); ++i) - if (k == m_drawRule[i]) - return; - auto i = lower_bound(m_drawRule.begin(), m_drawRule.end(), k.m_scale, less_scales()); + for (; i != m_drawRule.end() && i->m_scale == k.m_scale; ++i) + if (k == *i) + return; // already exists m_drawRule.insert(i, k); } diff --git a/indexer/drules_selector_parser.hpp b/indexer/drules_selector_parser.hpp index f0e511a24f..0a52e0d746 100644 --- a/indexer/drules_selector_parser.hpp +++ b/indexer/drules_selector_parser.hpp @@ -8,14 +8,30 @@ namespace drule enum SelectorOperatorType { SelectorOperatorUnknown = 0, - SelectorOperatorNotEqual, // [tag!=value] - SelectorOperatorLessOrEqual, // [tag<=value] - SelectorOperatorGreaterOrEqual, // [tag>=value] - SelectorOperatorEqual, // [tag=value] - SelectorOperatorLess, // [tagvalue] - SelectorOperatorIsNotSet, // [!tag] - SelectorOperatorIsSet, // [tag] + + // [tag!=value] + SelectorOperatorNotEqual, + + // [tag<=value] + SelectorOperatorLessOrEqual, + + // [tag>=value] + SelectorOperatorGreaterOrEqual, + + // [tag=value] + SelectorOperatorEqual, + + // [tagvalue] + SelectorOperatorGreater, + + // [!tag] + SelectorOperatorIsNotSet, + + // [tag] + SelectorOperatorIsSet, }; struct SelectorExpression