summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2016-08-26 18:40:48 -0400
committerMathias Stearn <mathias@10gen.com>2016-08-29 15:34:16 -0400
commitd6d263b0c8fe21ac9bfca561515dccbe02f72e64 (patch)
tree60ea8f2057591bb46967276ca7d6f34588446f9c /src/mongo/db/pipeline
parent2374ef1a3ac05e3fca39485ef4824f559b1c082c (diff)
downloadmongo-d6d263b0c8fe21ac9bfca561515dccbe02f72e64.tar.gz
SERVER-23100 Allow StringBuilder and str::stream to return StringData views
Avoids unnecessary copies when passing result to a function.
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/document_source_out.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/document_source_out.cpp b/src/mongo/db/pipeline/document_source_out.cpp
index 4bfc5e14247..b4ff0aa19bc 100644
--- a/src/mongo/db/pipeline/document_source_out.cpp
+++ b/src/mongo/db/pipeline/document_source_out.cpp
@@ -131,8 +131,8 @@ boost::optional<Document> DocumentSourceOut::getNext() {
// We will write all results into a temporary collection, then rename the temporary collection
// to be the target collection once we are done.
- _tempNs = NamespaceString(StringData(str::stream() << _outputNs.db() << ".tmp.agg_out."
- << aggOutCounter.addAndFetch(1)));
+ _tempNs = NamespaceString(str::stream() << _outputNs.db() << ".tmp.agg_out."
+ << aggOutCounter.addAndFetch(1));
auto renameCommandObj =
BSON("renameCollection" << _tempNs.ns() << "to" << _outputNs.ns() << "dropTarget" << true);