diff options
author | Dwight <dmerriman@gmail.com> | 2010-01-15 17:33:44 -0500 |
---|---|---|
committer | Dwight <dmerriman@gmail.com> | 2010-01-15 17:33:44 -0500 |
commit | 0165ec1fda0ce57506cfb307bc9d198e9cdab8be (patch) | |
tree | fa177565cfbc8262d3a2b8e967605e43459aed63 | |
parent | 95ba1b843ec69b2fba574b2a502f3df7efe33d92 (diff) | |
download | mongo-0165ec1fda0ce57506cfb307bc9d198e9cdab8be.tar.gz |
fix extraneous info put in profiler objects, and make a tiny bit faster (updates) too
-rw-r--r-- | db/pdfile.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/db/pdfile.cpp b/db/pdfile.cpp index 62c37960de9..a5f8c5ffdc5 100644 --- a/db/pdfile.cpp +++ b/db/pdfile.cpp @@ -811,7 +811,8 @@ namespace mongo { d->paddingFits(); /* have any index keys changed? */ - if( d->nIndexes ) { + { + unsigned keyUpdates = 0; for ( int x = 0; x < d->nIndexes; x++ ) { IndexDetails& idx = d->idx(x); for ( unsigned i = 0; i < changes[x].removed.size(); i++ ) { @@ -825,6 +826,7 @@ namespace mongo { } assert( !dl.isNull() ); BSONObj idxKey = idx.info.obj().getObjectField("key"); + keyUpdates += changes[x].added.size(); for ( unsigned i = 0; i < changes[x].added.size(); i++ ) { try { /* we did the dupCheck() above. so we don't have to worry about it here. */ @@ -837,11 +839,10 @@ namespace mongo { out() << " caught assertion update index " << idx.indexNamespace() << '\n'; problem() << " caught assertion update index " << idx.indexNamespace() << endl; } - if ( cc().database()->profile ) - ss << "\n" << changes[x].added.size() << " key updates "; } - } + if( keyUpdates && cc().database()->profile ) + ss << '\n' << keyUpdates << " key updates "; } // update in place |