From 8b070fbabb6f65b978d13d2267b299fa4a41b690 Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 9 May 2014 17:09:25 +0300 Subject: [PATCH] variable rename in flush_helper --- include/c11log/details/flush_helper.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/c11log/details/flush_helper.h b/include/c11log/details/flush_helper.h index 084f7447..73ce3adf 100644 --- a/include/c11log/details/flush_helper.h +++ b/include/c11log/details/flush_helper.h @@ -11,21 +11,21 @@ class file_flush_helper public: explicit file_flush_helper(const std::size_t flush_every): _flush_every(flush_every), - _write_counter(0) {}; + _flush_countdown(flush_every) {}; void write(const std::string& msg, std::ofstream& ofs) { ofs.write(msg.data(), msg.size()); - if(++_write_counter == _flush_every) + if(--_flush_countdown == 0) { ofs.flush(); - _write_counter = 0; + _flush_countdown = _flush_every; } } private: const std::size_t _flush_every; - std::size_t _write_counter; + std::size_t _flush_countdown; }; } }