summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_set.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/index_set.cpp')
-rw-r--r--src/mongo/db/index_set.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/index_set.cpp b/src/mongo/db/index_set.cpp
index 65f74ed54ea..2d30e985c73 100644
--- a/src/mongo/db/index_set.cpp
+++ b/src/mongo/db/index_set.cpp
@@ -21,6 +21,8 @@
namespace mongo {
+ IndexPathSet::IndexPathSet() : _allPathsIndexed( false ) { }
+
void IndexPathSet::addPath( const StringData& path ) {
string s;
if ( getCanonicalIndexField( path, &s ) ) {
@@ -31,11 +33,20 @@ namespace mongo {
}
}
+ void IndexPathSet::allPathsIndexed() {
+ _allPathsIndexed = true;
+ }
+
void IndexPathSet::clear() {
_canonical.clear();
+ _allPathsIndexed = false;
}
bool IndexPathSet::mightBeIndexed( const StringData& path ) const {
+ if ( _allPathsIndexed ) {
+ return true;
+ }
+
StringData use = path;
string x;
if ( getCanonicalIndexField( path, &x ) )