コード例 #1
0
ファイル: btreecursor.cpp プロジェクト: fes/mongo
 /* skip unused keys. */
 void BtreeCursor::skipUnusedKeys() {
     int u = 0;
     while ( 1 ) {
         if ( !ok() )
             break;
         BtreeBucket *b = bucket.btree();
         _KeyNode& kn = b->k(keyOfs);
         if ( kn.isUsed() )
             break;
         bucket = b->advance(bucket, keyOfs, direction, "skipUnusedKeys");
         u++;
     }
     if ( u > 10 )
         OCCASIONALLY log() << "btree unused skipped:" << u << '\n';
 }
コード例 #2
0
ファイル: btreecursor.cpp プロジェクト: kapouer/mongo-debian
 /* skip unused keys. */
 bool BtreeCursor::skipUnusedKeys( bool mayJump ) {
     int u = 0;
     while ( 1 ) {
         if ( !ok() )
             break;
         BtreeBucket *b = bucket.btree();
         _KeyNode& kn = b->k(keyOfs);
         if ( kn.isUsed() )
             break;
         bucket = b->advance(bucket, keyOfs, direction, "skipUnusedKeys");
         u++;
         if ( mayJump && ( u % 10 == 0 ) ) {
             skipOutOfRangeKeysAndCheckEnd();
         }
     }
     if ( u > 10 )
         OCCASIONALLY log() << "btree unused skipped:" << u << '\n';
     return u;
 }