mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
fast done capability for BSONObjBuilder
This commit is contained in:
parent
ce531f1481
commit
8443231430
@ -508,6 +508,11 @@ namespace mongo {
|
||||
return BSONObj(_done());
|
||||
}
|
||||
|
||||
// Like 'done' above, but does not construct a BSONObj to return to the caller.
|
||||
void doneFast() {
|
||||
(void)_done();
|
||||
}
|
||||
|
||||
/** Peek at what is in the builder, but leave the builder ready for more appends.
|
||||
The returned object is only valid until the next modification or destruction of the builder.
|
||||
Intended use case: append a field if not already there.
|
||||
@ -639,6 +644,8 @@ namespace mongo {
|
||||
|
||||
BSONObj done() { return _b.done(); }
|
||||
|
||||
void doneFast() { _b.doneFast(); }
|
||||
|
||||
template <typename T>
|
||||
BSONArrayBuilder& append(const StringData& name, const T& x){
|
||||
fill( name );
|
||||
|
Loading…
Reference in New Issue
Block a user