From 0c8017dbae7fa668ceb5aa135f857b34ea6ca8f5 Mon Sep 17 00:00:00 2001 From: stash93 Date: Mon, 18 May 2015 23:44:52 +0300 Subject: [PATCH] Remove duplicated code Summary: Call Flush() function instead Test Plan: make all check Reviewers: igor Reviewed By: igor Subscribers: dhruba Differential Revision: https://reviews.facebook.net/D38583 --- util/posix_logger.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/util/posix_logger.h b/util/posix_logger.h index 1f663435f..213a652c7 100644 --- a/util/posix_logger.h +++ b/util/posix_logger.h @@ -146,9 +146,7 @@ class PosixLogger : public Logger { uint64_t now_micros = static_cast(now_tv.tv_sec) * 1000000 + now_tv.tv_usec; if (now_micros - last_flush_micros_ >= flush_every_seconds_ * 1000000) { - flush_pending_ = false; - fflush(file_); - last_flush_micros_ = now_micros; + Flush(); } if (base != buffer) { delete[] base;