Avoid un necessary move when popping circular_q

This commit is contained in:
gabime 2019-09-17 12:01:15 +03:00
parent d52cf87d71
commit 27cc76766c
2 changed files with 2 additions and 2 deletions

View File

@ -66,8 +66,8 @@ SPDLOG_INLINE void backtracer::foreach_pop(std::function<void(const details::log
while (!messages_.empty()) while (!messages_.empty())
{ {
auto &front_msg = messages_.front(); auto &front_msg = messages_.front();
messages_.pop_front();
fun(front_msg); fun(front_msg);
messages_.pop_front();
} }
} }
} // namespace details } // namespace details

View File

@ -139,7 +139,7 @@ private:
filename_t current_file = filename(); filename_t current_file = filename();
if (filenames_q_.full()) if (filenames_q_.full())
{ {
auto &old_filename = filenames_q_.front(); auto old_filename = std::move(filenames_q_.front());
filenames_q_.pop_front(); filenames_q_.pop_front();
bool ok = remove_if_exists(old_filename) == 0; bool ok = remove_if_exists(old_filename) == 0;
if (!ok) if (!ok)