From 33580fa39a0aef3d1115e47fb4f13154be5e5993 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Mon, 29 Sep 2014 22:53:39 +0200 Subject: [PATCH] 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 --- db/db_impl.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index 7f5a382c0..3bf60a2d1 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -4037,11 +4037,10 @@ Status DBImpl::Write(const WriteOptions& options, WriteBatch* my_batch) { RecordTick(stats_, WAL_FILE_BYTES, log_size); if (status.ok() && options.sync) { RecordTick(stats_, WAL_FILE_SYNCED); + StopWatch sw(env_, stats_, WAL_FILE_SYNC_MICROS); if (db_options_.use_fsync) { - StopWatch(env_, stats_, WAL_FILE_SYNC_MICROS); status = log_->file()->Fsync(); } else { - StopWatch(env_, stats_, WAL_FILE_SYNC_MICROS); status = log_->file()->Sync(); } }