@@ -393,9 +393,7 @@ CursorRegResult CheckpointManager::registerCursorBySeqno(
393393 // nextSeqnoAvailableFromCheckpoint
394394 const uint64_t nextSeqnoAvailableFromCheckpoint = lastBySeqno + 1 ;
395395 const auto tryBackfill =
396- (nextSeqnoAvailableFromCheckpoint == lastProcessedSeqno + 1
397- ? false
398- : true );
396+ (nextSeqnoAvailableFromCheckpoint != lastProcessedSeqno + 1 );
399397 return createCursorRegResult ((*ckptIt)->begin (),
400398 0 ,
401399 tryBackfill,
@@ -465,8 +463,7 @@ CursorRegResult CheckpointManager::registerCursorBySeqno(
465463 if (lastProcessedSeqno < *st) {
466464 // Trigger backfill only if there's a gap between lastProcessedSeqno
467465 // and st
468- const auto tryBackfill =
469- (*st == lastProcessedSeqno + 1 ? false : true );
466+ const auto tryBackfill = (*st != lastProcessedSeqno + 1 );
470467 return createCursorRegResult (ckpt.begin (), 0 , tryBackfill, *st);
471468 }
472469
@@ -834,10 +831,9 @@ std::vector<Cursor> CheckpointManager::getListOfCursorsToDrop() {
834831 // the backup cursor exists. So that can be exploited to simplify
835832 // the logic further here.
836833
837- const auto backupExists =
838- cursors.find (backupPCursorName) != cursors.end ();
839- const auto & specialCursor = backupExists
840- ? *cursors.at (backupPCursorName)
834+ const auto backupFound = cursors.find (backupPCursorName);
835+ const auto & specialCursor = (backupFound != cursors.end ())
836+ ? *backupFound->second
841837 : *persistenceCursor;
842838
843839 for (const auto & pair : cursors) {
@@ -1294,8 +1290,8 @@ uint64_t CheckpointManager::getMaxVisibleSeqno() const {
12941290std::shared_ptr<CheckpointCursor>
12951291CheckpointManager::getBackupPersistenceCursor () {
12961292 std::lock_guard<std::mutex> lh (queueLock);
1297- const auto exists = cursors.find (backupPCursorName) != cursors. end ( );
1298- return exists ? cursors[backupPCursorName] : nullptr ;
1293+ const auto backupFound = cursors.find (backupPCursorName);
1294+ return (backupFound != cursors. end ()) ? backupFound-> second : nullptr ;
12991295}
13001296
13011297void CheckpointManager::dump () const {
0 commit comments