diff options
Diffstat (limited to 'src/mongo/db/fts/fts_element_iterator.cpp')
-rw-r--r-- | src/mongo/db/fts/fts_element_iterator.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/db/fts/fts_element_iterator.cpp b/src/mongo/db/fts/fts_element_iterator.cpp index ebca711dd2b..c9666f0834a 100644 --- a/src/mongo/db/fts/fts_element_iterator.cpp +++ b/src/mongo/db/fts/fts_element_iterator.cpp @@ -64,7 +64,7 @@ inline bool _matchPrefix(const string& dottedName, const string& weight) { } return str::startsWith(weight, dottedName + '.'); } -} +} // namespace bool FTSElementIterator::more() { //_currentValue = advance(); @@ -113,9 +113,10 @@ FTSIteratorValue FTSElementIterator::advance() { // 1. parent path empty (top level): use the current field name // 2. parent path non-empty and obj is an array: use the parent path // 3. parent path non-empty and obj is a sub-doc: append field name to parent path - string dottedName = (_frame._parentPath.empty() ? fieldName : _frame._isArray - ? _frame._parentPath - : _frame._parentPath + '.' + fieldName); + string dottedName = + (_frame._parentPath.empty() + ? fieldName + : _frame._isArray ? _frame._parentPath : _frame._parentPath + '.' + fieldName); // Find lower bound of dottedName in _weights. lower_bound leaves us at the first // weight that could possibly match or be a prefix of dottedName. And if this |