-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.5.3
-
Component/s: Internal Client
-
None
-
Environment:All
-
Fully Compatible
Consider the following code:
const char kKey[] = "key";
const char kValue[] = "value";
someBSONObjBuilder.append(key, value);
This is going to cause two calls to strlen which certainly don't need to be made, since the lengths of kKey and kValue are known at compile time. For such cases, it would be nice to have a mechanism to pass the already known size down to the BSONObjBuilder:
someBSONObjBuilder.append(key, sizeof(key), value, sizeof(value));
Similar overloads would need to be made for each type'd BSONObjBuilder::append(key, sizeof(key), T), and for BSONArrayBuilder.
- depends on
-
SERVER-1452 Prevent unnecessary c_str() calling into BSONObjBuilder
- Closed