This function is called from the following if condition (in checkAndUpdate() function):

```
if (... || mdNewVSize != mdVSize || !equalMetadataVectors(mdV, mdNewV)) { ... }
```

Thus, if I'm interpreting correctly the left-to-right semantics in logical expresions in C++, if the vectors are not equal the condition is right, the `{ ... }` block is executed and equalMetadataVectors() is never called. Or, in other words, if equalMetadata() is called then we can assure that both vectors are equal.

Having said that, it could be great if we have some size() or len() method for BSONObj so we can early check that at the beginging of the function and early return false if sizes are not equal. However, after looking the API of BSONObj class at http://api.mongodb.org/cplusplus/2.2.3/classmongo_1_1_b_s_o_n_obj.html it is not clear to me (I'm afraid that the documentation of the MongoDB C++ driver is not very good).

NTC