Skip to content

Commit

Permalink
iterall for HashTable
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Jan 15, 2010
1 parent 02e33da commit 4539b8e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion util/hashtab.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,17 @@ namespace mongo {
nodes[i].value = value;
return true;
}


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 );
}
}

};

#pragma pack()
Expand Down

0 comments on commit 4539b8e

Please sign in to comment.