summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-03-20 16:20:46 -0400
committerAaron <aaron@10gen.com>2009-03-20 16:20:46 -0400
commit2570f4824cbc278c2b0991ee54a20ddddd34aadc (patch)
tree432c29fc82d3d997007790e0470c013303fa275e /db
parentd654edbef4553bd354850b10863631323db92660 (diff)
downloadmongo-2570f4824cbc278c2b0991ee54a20ddddd34aadc.tar.gz
const ref
Diffstat (limited to 'db')
-rw-r--r--db/jsobj.cpp4
-rw-r--r--db/jsobj.h6
-rw-r--r--db/matcher.cpp4
-rw-r--r--db/matcher.h2
4 files changed, 8 insertions, 8 deletions
diff --git a/db/jsobj.cpp b/db/jsobj.cpp
index a9eed7f6d75..5beda57f66c 100644
--- a/db/jsobj.cpp
+++ b/db/jsobj.cpp
@@ -540,7 +540,7 @@ namespace mongo {
// a : 3
// else we just append the element.
//
- void appendElementHandlingGtLt(BSONObjBuilder& b, BSONElement& e) {
+ void appendElementHandlingGtLt(BSONObjBuilder& b, const BSONElement& e) {
if ( e.type() == Object ) {
BSONElement fe = e.embeddedObject().firstElement();
const char *fn = fe.fieldName();
@@ -552,7 +552,7 @@ namespace mongo {
b.append(e);
}
- int getGtLtOp(BSONElement& e) {
+ int getGtLtOp(const BSONElement& e) {
if ( e.type() != Object )
return JSMatcher::Equality;
diff --git a/db/jsobj.h b/db/jsobj.h
index 6faf31481ed..917d1c94c4b 100644
--- a/db/jsobj.h
+++ b/db/jsobj.h
@@ -421,7 +421,7 @@ namespace mongo {
/* l and r MUST have same type when called: check that first. */
int compareElementValues(const BSONElement& l, const BSONElement& r);
- int getGtLtOp(BSONElement& e);
+ int getGtLtOp(const BSONElement& e);
/* compare values with type check.
note: as is now, not smart about int/double comingling. TODO
@@ -770,7 +770,7 @@ namespace mongo {
one gets
{ age : { $gt : someElement's value } }
*/
- BSONObjBuilder& operator<<( BSONElement& e );
+ BSONObjBuilder& operator<<( const BSONElement& e );
private:
const Label &l_;
BSONObjBuilderValueStream *s_;
@@ -1308,7 +1308,7 @@ namespace mongo {
}
inline
- BSONObjBuilder& Labeler::operator<<( BSONElement& e ) {
+ BSONObjBuilder& Labeler::operator<<( const BSONElement& e ) {
s_->_subobj->appendAs( e, l_.l_ );
return *s_->_builder;
}
diff --git a/db/matcher.cpp b/db/matcher.cpp
index 73cda343333..dbf407d33e2 100644
--- a/db/matcher.cpp
+++ b/db/matcher.cpp
@@ -379,7 +379,7 @@ namespace mongo {
extern int dump;
- inline bool _regexMatches(RegexMatcher& rm, BSONElement& e) {
+ inline bool _regexMatches(RegexMatcher& rm, const BSONElement& e) {
char buf[64];
const char *p = buf;
if ( e.type() == String || e.type() == Symbol )
@@ -397,7 +397,7 @@ namespace mongo {
return rm.re->PartialMatch(p);
}
/* todo: internal dotted notation scans -- not done yet here. */
- inline bool regexMatches(RegexMatcher& rm, BSONElement& e, bool *deep) {
+ inline bool regexMatches(RegexMatcher& rm, const BSONElement& e, bool *deep) {
if ( e.type() != Array )
return _regexMatches(rm, e);
diff --git a/db/matcher.h b/db/matcher.h
index 450eb0de83e..6fb621f6dab 100644
--- a/db/matcher.h
+++ b/db/matcher.h
@@ -109,7 +109,7 @@ namespace mongo {
bool trivial() const { return n == 0 && nRegex == 0 && where == 0; }
private:
- void addBasic(BSONElement e, int c) {
+ void addBasic(const BSONElement &e, int c) {
// TODO May want to selectively ignore these element types based on op type.
if ( e.type() == MinKey || e.type() == MaxKey )
return;