summaryrefslogtreecommitdiff
path: root/db/dbeval.cpp
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-01-14 17:17:24 -0500
committerAaron <aaron@10gen.com>2009-01-14 17:17:24 -0500
commit248a6dd8deab804423944ad1d0bdf234200fef84 (patch)
treeafd4a0e40f8818187903108e4c38a34bf4097482 /db/dbeval.cpp
parentad1f6b3cbdd1183eedc04f98fa813e63ce68a408 (diff)
downloadmongo-248a6dd8deab804423944ad1d0bdf234200fef84.tar.gz
Replace tab indentation with spaces
Diffstat (limited to 'db/dbeval.cpp')
-rw-r--r--db/dbeval.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/db/dbeval.cpp b/db/dbeval.cpp
index 3620211e6f7..de05394d10a 100644
--- a/db/dbeval.cpp
+++ b/db/dbeval.cpp
@@ -38,13 +38,18 @@ const int edebug=0;
bool dbEval(const char *ns, BSONObj& cmd, BSONObjBuilder& result, string& errmsg) {
BSONElement e = cmd.firstElement();
assert( e.type() == Code || e.type() == CodeWScope || e.type() == String );
-
+
const char *code = 0;
- switch ( e.type() ){
- case String:
- case Code: code = e.valuestr(); break;
- case CodeWScope: code = e.codeWScopeCode(); break;
- default: assert(0);
+ switch ( e.type() ) {
+ case String:
+ case Code:
+ code = e.valuestr();
+ break;
+ case CodeWScope:
+ code = e.codeWScopeCode();
+ break;
+ default:
+ assert(0);
}
assert( code );
@@ -80,7 +85,7 @@ bool dbEval(const char *ns, BSONObj& cmd, BSONObjBuilder& result, string& errmsg
res = s.invoke(f);
int m = t.millis();
if ( m > 100 ) {
- stdcout() << "TEMP: dbeval too slow:" << endl;
+ stdcout() << "TEMP: dbeval too slow:" << endl;
problem() << "dbeval time: " << dec << m << "ms " << ns << endl;
OCCASIONALLY log() << code << endl;
else if ( m >= 1000 ) log() << code << endl;
@@ -92,7 +97,7 @@ bool dbEval(const char *ns, BSONObj& cmd, BSONObjBuilder& result, string& errmsg
errmsg += s.getString( "error" );
return false;
}
-
+
int type = s.type("return");
if ( type == Object || type == Array )
result.append("retval", s.getObject("return"));