Skip to content

Commit 33580fa

Browse files
committed
db/db_impl.cc: fix object handling, remove double lines
Fix for: [db/db_impl.cc:4039]: (error) Instance of 'StopWatch' object is destroyed immediately. [db/db_impl.cc:4042]: (error) Instance of 'StopWatch' object is destroyed immediately. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
1 parent 873f135 commit 33580fa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

db/db_impl.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -4037,11 +4037,10 @@ Status DBImpl::Write(const WriteOptions& options, WriteBatch* my_batch) {
40374037
RecordTick(stats_, WAL_FILE_BYTES, log_size);
40384038
if (status.ok() && options.sync) {
40394039
RecordTick(stats_, WAL_FILE_SYNCED);
4040+
StopWatch sw(env_, stats_, WAL_FILE_SYNC_MICROS);
40404041
if (db_options_.use_fsync) {
4041-
StopWatch(env_, stats_, WAL_FILE_SYNC_MICROS);
40424042
status = log_->file()->Fsync();
40434043
} else {
4044-
StopWatch(env_, stats_, WAL_FILE_SYNC_MICROS);
40454044
status = log_->file()->Sync();
40464045
}
40474046
}

0 commit comments

Comments
 (0)