summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_legacy.cpp
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 00:22:50 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 10:56:02 -0400
commit9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch)
tree3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/db/index_legacy.cpp
parent01965cf52bce6976637ecb8f4a622aeb05ab256a (diff)
downloadmongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/index_legacy.cpp')
-rw-r--r--src/mongo/db/index_legacy.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/mongo/db/index_legacy.cpp b/src/mongo/db/index_legacy.cpp
index 9131fedee3c..ca6a97ce3e9 100644
--- a/src/mongo/db/index_legacy.cpp
+++ b/src/mongo/db/index_legacy.cpp
@@ -37,49 +37,49 @@
namespace mongo {
- // static
- BSONObj IndexLegacy::adjustIndexSpecObject(const BSONObj& obj) {
- string pluginName = IndexNames::findPluginName(obj.getObjectField("key"));
+// static
+BSONObj IndexLegacy::adjustIndexSpecObject(const BSONObj& obj) {
+ string pluginName = IndexNames::findPluginName(obj.getObjectField("key"));
- if (IndexNames::TEXT == pluginName) {
- return fts::FTSSpec::fixSpec(obj);
- }
-
- if (IndexNames::GEO_2DSPHERE == pluginName) {
- return S2AccessMethod::fixSpec(obj);
- }
+ if (IndexNames::TEXT == pluginName) {
+ return fts::FTSSpec::fixSpec(obj);
+ }
- return obj;
+ if (IndexNames::GEO_2DSPHERE == pluginName) {
+ return S2AccessMethod::fixSpec(obj);
}
- // static
- BSONObj IndexLegacy::getMissingField(OperationContext* txn,
- Collection* collection,
- const BSONObj& infoObj) {
- BSONObj keyPattern = infoObj.getObjectField( "key" );
- string accessMethodName;
- if ( collection )
- accessMethodName = collection->getIndexCatalog()->getAccessMethodName(txn, keyPattern);
- else
- accessMethodName = IndexNames::findPluginName(keyPattern);
+ return obj;
+}
+
+// static
+BSONObj IndexLegacy::getMissingField(OperationContext* txn,
+ Collection* collection,
+ const BSONObj& infoObj) {
+ BSONObj keyPattern = infoObj.getObjectField("key");
+ string accessMethodName;
+ if (collection)
+ accessMethodName = collection->getIndexCatalog()->getAccessMethodName(txn, keyPattern);
+ else
+ accessMethodName = IndexNames::findPluginName(keyPattern);
- if (IndexNames::HASHED == accessMethodName ) {
- int hashVersion = infoObj["hashVersion"].numberInt();
- HashSeed seed = infoObj["seed"].numberInt();
+ if (IndexNames::HASHED == accessMethodName) {
+ int hashVersion = infoObj["hashVersion"].numberInt();
+ HashSeed seed = infoObj["seed"].numberInt();
- // Explicit null valued fields and missing fields are both represented in hashed indexes
- // using the hash value of the null BSONElement. This is partly for historical reasons
- // (hash of null was used in the initial release of hashed indexes and changing would
- // alter the data format). Additionally, in certain places the hashed index code and
- // the index bound calculation code assume null and missing are indexed identically.
- BSONObj nullObj = BSON("" << BSONNULL);
- return BSON("" << ExpressionKeysPrivate::makeSingleHashKey(nullObj.firstElement(), seed, hashVersion));
- }
- else {
- BSONObjBuilder b;
- b.appendNull("");
- return b.obj();
- }
+ // Explicit null valued fields and missing fields are both represented in hashed indexes
+ // using the hash value of the null BSONElement. This is partly for historical reasons
+ // (hash of null was used in the initial release of hashed indexes and changing would
+ // alter the data format). Additionally, in certain places the hashed index code and
+ // the index bound calculation code assume null and missing are indexed identically.
+ BSONObj nullObj = BSON("" << BSONNULL);
+ return BSON("" << ExpressionKeysPrivate::makeSingleHashKey(
+ nullObj.firstElement(), seed, hashVersion));
+ } else {
+ BSONObjBuilder b;
+ b.appendNull("");
+ return b.obj();
}
+}
} // namespace mongo