summaryrefslogtreecommitdiff
path: root/util/hashtab.h
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2011-09-14 17:08:06 +0200
committerAntonin Kral <a.kral@bobek.cz>2011-09-14 17:08:06 +0200
commit5d342a758c6095b4d30aba0750b54f13b8916f51 (patch)
tree762e9aa84781f5e3b96db2c02d356c29cf0217c0 /util/hashtab.h
parentcbe2d992e9cd1ea66af9fa91df006106775d3073 (diff)
downloadmongodb-5d342a758c6095b4d30aba0750b54f13b8916f51.tar.gz
Imported Upstream version 2.0.0
Diffstat (limited to 'util/hashtab.h')
-rw-r--r--util/hashtab.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/util/hashtab.h b/util/hashtab.h
index 6818bef..f1a3306 100644
--- a/util/hashtab.h
+++ b/util/hashtab.h
@@ -54,7 +54,7 @@ namespace mongo {
}
};
void* _buf;
- int n;
+ int n; // number of hashtable buckets
int maxChain;
Node& nodes(int i) {
@@ -156,9 +156,9 @@ namespace mongo {
typedef void (*IteratorCallback)( const Key& k , Type& v );
void iterAll( IteratorCallback callback ) {
for ( int i=0; i<n; i++ ) {
- if ( ! nodes(i).inUse() )
- continue;
- callback( nodes(i).k , nodes(i).value );
+ if ( nodes(i).inUse() ) {
+ callback( nodes(i).k , nodes(i).value );
+ }
}
}
@@ -166,9 +166,9 @@ namespace mongo {
typedef void (*IteratorCallback2)( const Key& k , Type& v , void * extra );
void iterAll( IteratorCallback2 callback , void * extra ) {
for ( int i=0; i<n; i++ ) {
- if ( ! nodes(i).inUse() )
- continue;
- callback( nodes(i).k , nodes(i).value , extra );
+ if ( nodes(i).inUse() ) {
+ callback( nodes(i).k , nodes(i).value , extra );
+ }
}
}