summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/accumulator_push.cpp
diff options
context:
space:
mode:
authorU-tellus\cwestin <cwestin@10gen.com>2012-01-10 14:28:56 -0800
committerU-tellus\cwestin <cwestin@10gen.com>2012-01-10 14:52:59 -0800
commit8427b4eb0180862bd4530fdd46b76ef933ae4087 (patch)
treec24bc4bcae2e3369a2c9ff208de7bf9677eda779 /src/mongo/db/pipeline/accumulator_push.cpp
parent4294f8eb2c6c1c6747de5b93667b5dc8ec654209 (diff)
downloadmongo-8427b4eb0180862bd4530fdd46b76ef933ae4087.tar.gz
fixed emacs to remove tabs from files before writing; removed tabs
Diffstat (limited to 'src/mongo/db/pipeline/accumulator_push.cpp')
-rwxr-xr-xsrc/mongo/db/pipeline/accumulator_push.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/mongo/db/pipeline/accumulator_push.cpp b/src/mongo/db/pipeline/accumulator_push.cpp
index 2640bc4ecfd..b0c11dcf70f 100755
--- a/src/mongo/db/pipeline/accumulator_push.cpp
+++ b/src/mongo/db/pipeline/accumulator_push.cpp
@@ -24,27 +24,27 @@ namespace mongo {
intrusive_ptr<const Value> AccumulatorPush::evaluate(
const intrusive_ptr<Document> &pDocument) const {
assert(vpOperand.size() == 1);
- intrusive_ptr<const Value> prhs(vpOperand[0]->evaluate(pDocument));
+ intrusive_ptr<const Value> prhs(vpOperand[0]->evaluate(pDocument));
- if (prhs->getType() == Undefined)
- ; /* nothing to add to the array */
- else if (!pCtx->getInRouter())
- vpValue.push_back(prhs);
- else {
- /*
- If we're in the router, we need to take apart the arrays we
- receive and put their elements into the array we are collecting.
- If we didn't, then we'd get an array of arrays, with one array
- from each shard that responds.
- */
- assert(prhs->getType() == Array);
-
- intrusive_ptr<ValueIterator> pvi(prhs->getArray());
- while(pvi->more()) {
- intrusive_ptr<const Value> pElement(pvi->next());
- vpValue.push_back(pElement);
- }
- }
+ if (prhs->getType() == Undefined)
+ ; /* nothing to add to the array */
+ else if (!pCtx->getInRouter())
+ vpValue.push_back(prhs);
+ else {
+ /*
+ If we're in the router, we need to take apart the arrays we
+ receive and put their elements into the array we are collecting.
+ If we didn't, then we'd get an array of arrays, with one array
+ from each shard that responds.
+ */
+ assert(prhs->getType() == Array);
+
+ intrusive_ptr<ValueIterator> pvi(prhs->getArray());
+ while(pvi->more()) {
+ intrusive_ptr<const Value> pElement(pvi->next());
+ vpValue.push_back(pElement);
+ }
+ }
return Value::getNull();
}
@@ -54,20 +54,20 @@ namespace mongo {
}
AccumulatorPush::AccumulatorPush(
- const intrusive_ptr<ExpressionContext> &pTheCtx):
+ const intrusive_ptr<ExpressionContext> &pTheCtx):
Accumulator(),
vpValue(),
pCtx(pTheCtx) {
}
intrusive_ptr<Accumulator> AccumulatorPush::create(
- const intrusive_ptr<ExpressionContext> &pCtx) {
- intrusive_ptr<AccumulatorPush> pAccumulator(
- new AccumulatorPush(pCtx));
+ const intrusive_ptr<ExpressionContext> &pCtx) {
+ intrusive_ptr<AccumulatorPush> pAccumulator(
+ new AccumulatorPush(pCtx));
return pAccumulator;
}
const char *AccumulatorPush::getOpName() const {
- return "$push";
+ return "$push";
}
}