/* 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'; }
/* 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; }