summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2013-05-29 18:31:51 -0400
committerMathias Stearn <mathias@10gen.com>2013-06-18 12:51:15 -0400
commitbe4e909ad1ae382a073f456710052a65c2b5fd39 (patch)
tree97fcb4fe336664c5651d262b5965baafa593d6fa /src/mongo/db/pipeline/document.h
parentf71dfdc67408a2fc0d695f865ad3abbb116ed443 (diff)
downloadmongo-be4e909ad1ae382a073f456710052a65c2b5fd39.tar.gz
Add Value::consume() to create an Array-typed Value without copying
Currently few places construct arrays, but more are coming soon. Note that this can't be used for things like $push's getValue() since that can be called multiple times so the array needs to be preserved.
Diffstat (limited to 'src/mongo/db/pipeline/document.h')
-rw-r--r--src/mongo/db/pipeline/document.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/document.h b/src/mongo/db/pipeline/document.h
index 375cd48faa3..77c04bafb3f 100644
--- a/src/mongo/db/pipeline/document.h
+++ b/src/mongo/db/pipeline/document.h
@@ -467,7 +467,7 @@ namespace mongo {
return *this << Value(val);
}
- Value done() { return Value(_array); }
+ Value done() { return Value::consume(_array); }
private:
vector<Value> _array;