summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/bson/bsonmisc.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mongo/bson/bsonmisc.h b/src/mongo/bson/bsonmisc.h
index b215bf21bdd..be6b0622873 100644
--- a/src/mongo/bson/bsonmisc.h
+++ b/src/mongo/bson/bsonmisc.h
@@ -188,9 +188,8 @@ namespace mongo {
}
void got( int size ) {
- _sizes[_pos++] = size;
- if ( _pos >= SIZE )
- _pos = 0;
+ _sizes[_pos] = size;
+ _pos = (_pos + 1) % SIZE; // thread safe at least on certain compilers
}
/**