summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2008-06-02 23:08:55 -0400
committerDwight <dmerriman@gmail.com>2008-06-02 23:08:55 -0400
commit4cd64845186ceecdd196a38ee1778b3f99f4e5ea (patch)
tree3f7144d603a3e994b8aa286800af247972a56896
parent1c6210915469d1b4fb3e843e604f3d7ab87c1f9b (diff)
downloadmongo-4cd64845186ceecdd196a38ee1778b3f99f4e5ea.tar.gz
gcc
-rw-r--r--db/jsobj.cpp8
-rw-r--r--db/jsobj.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/db/jsobj.cpp b/db/jsobj.cpp
index 56cd9aa8722..26a9881fccf 100644
--- a/db/jsobj.cpp
+++ b/db/jsobj.cpp
@@ -404,7 +404,7 @@ inline int JSMatcher::valuesMatch(Element& l, Element& r, int op) {
0 missing element
1 match
*/
-int JSMatcher::matchesDotted(const char *fieldName, Element& toMatch, JSObj& obj, int compareOp, bool *deep, bool isArr = false) {
+int JSMatcher::matchesDotted(const char *fieldName, Element& toMatch, JSObj& obj, int compareOp, bool *deep, bool isArr) {
{
const char *p = strchr(fieldName, '.');
if( p ) {
@@ -416,7 +416,8 @@ int JSMatcher::matchesDotted(const char *fieldName, Element& toMatch, JSObj& obj
if( e.type() != Object && e.type() != Array )
return -1;
- return matchesDotted(p+1, toMatch, e.embeddedObject(), compareOp, deep, e.type() == Array);
+ JSObj eo = e.embeddedObject();
+ return matchesDotted(p+1, toMatch, eo, compareOp, deep, e.type() == Array);
}
}
@@ -441,7 +442,8 @@ int JSMatcher::matchesDotted(const char *fieldName, Element& toMatch, JSObj& obj
while( ai.more() ) {
Element z = ai.next();
if( z.type() == Object ) {
- int cmp = matchesDotted(fieldName, toMatch, z.embeddedObject(), compareOp, deep);
+ JSObj eo = z.embeddedObject();
+ int cmp = matchesDotted(fieldName, toMatch, eo, compareOp, deep);
if( cmp > 0 ) {
if( deep ) *deep = true;
return 1;
diff --git a/db/jsobj.h b/db/jsobj.h
index cf19609e995..f441064a97e 100644
--- a/db/jsobj.h
+++ b/db/jsobj.h
@@ -402,7 +402,7 @@ class JSMatcher {
int matchesDotted(
const char *fieldName,
Element& toMatch, JSObj& obj,
- int compareOp, bool *deep, bool isArr);
+ int compareOp, bool *deep, bool isArr = false);
public:
enum {