diff options
author | Dwight <dwight@10gen.com> | 2010-09-28 17:49:40 -0400 |
---|---|---|
committer | Dwight <dwight@10gen.com> | 2010-09-28 17:49:40 -0400 |
commit | c595bf62aab72db689edc8e70e1ebaef71b09bd2 (patch) | |
tree | 64373b1a7299c8005061a40da86f66ec75767dcf /db/namespace.h | |
parent | 52cfae0accf094daf7d2ad8fbcce23afab4d99fd (diff) | |
download | mongo-c595bf62aab72db689edc8e70e1ebaef71b09bd2.tar.gz |
more intent to write declarations
Diffstat (limited to 'db/namespace.h')
-rw-r--r-- | db/namespace.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/db/namespace.h b/db/namespace.h index 7479a21da24..ee15eea9887 100644 --- a/db/namespace.h +++ b/db/namespace.h @@ -260,11 +260,15 @@ namespace mongo { bool isMultikey(int i) { return (multiKeyIndexBits & (((unsigned long long) 1) << i)) != 0; } void setIndexIsMultikey(int i) { dassert( i < NIndexesMax ); - multiKeyIndexBits |= (((unsigned long long) 1) << i); + unsigned long long x = ((unsigned long long) 1) << i; + if( multiKeyIndexBits & x ) return; + *dur::writing(&multiKeyIndexBits) |= x; } void clearIndexIsMultikey(int i) { dassert( i < NIndexesMax ); - multiKeyIndexBits &= ~(((unsigned long long) 1) << i); + unsigned long long x = ((unsigned long long) 1) << i; + if( (multiKeyIndexBits & x) == 0 ) return; + *dur::writing(&multiKeyIndexBits) &= ~x; } /* add a new index. does not add to system.indexes etc. - just to NamespaceDetails. |