Skip to content

Commit

Permalink
remove dead modifier code
Browse files Browse the repository at this point in the history
  • Loading branch information
astaple committed Feb 7, 2012
1 parent da48652 commit b55c9c3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 47 deletions.
18 changes: 0 additions & 18 deletions src/mongo/db/ops/update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,24 +604,6 @@ namespace mongo {
}
}

void ModSet::extractFields( map< string, BSONElement > &fields, const BSONElement &top, const string &base ) {
if ( top.type() != Object ) {
fields[ base + top.fieldName() ] = top;
return;
}
BSONObjIterator i( top.embeddedObject() );
bool empty = true;
while( i.moreWithEOO() ) {
BSONElement e = i.next();
if ( e.eoo() )
break;
extractFields( fields, e, base + top.fieldName() + "." );
empty = false;
}
if ( empty )
fields[ base + top.fieldName() ] = top;
}

template< class Builder >
void ModSetState::_appendNewFromMods( const string& root , ModState& m , Builder& b , set<string>& onedownseen ) {
const char * temp = m.fieldName();
Expand Down
29 changes: 0 additions & 29 deletions src/mongo/db/ops/update.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,35 +279,6 @@ namespace mongo {
int _isIndexed;
bool _hasDynamicArray;

static void extractFields( map< string, BSONElement > &fields, const BSONElement &top, const string &base );

FieldCompareResult compare( const ModHolder::iterator &m, map< string, BSONElement >::iterator &p, const map< string, BSONElement >::iterator &pEnd ) const {
bool mDone = ( m == _mods.end() );
bool pDone = ( p == pEnd );
assert( ! mDone );
assert( ! pDone );
if ( mDone && pDone )
return SAME;
// If one iterator is done we want to read from the other one, so say the other one is lower.
if ( mDone )
return RIGHT_BEFORE;
if ( pDone )
return LEFT_BEFORE;

return compareDottedFieldNames( m->first, p->first.c_str() );
}

bool mayAddEmbedded( map< string, BSONElement > &existing, string right ) {
for( string left = EmbeddedBuilder::splitDot( right );
left.length() > 0 && left[ left.length() - 1 ] != '.';
left += "." + EmbeddedBuilder::splitDot( right ) ) {
if ( existing.count( left ) > 0 && existing[ left ].type() != Object )
return false;
if ( haveModForField( left.c_str() ) )
return false;
}
return true;
}
static Mod::Op opFromStr( const char *fn ) {
assert( fn[0] == '$' );
switch( fn[1] ) {
Expand Down

0 comments on commit b55c9c3

Please sign in to comment.