mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 01:51:38 +08:00
Avoid un necessary move when popping circular_q
This commit is contained in:
parent
d52cf87d71
commit
27cc76766c
@ -66,8 +66,8 @@ SPDLOG_INLINE void backtracer::foreach_pop(std::function<void(const details::log
|
||||
while (!messages_.empty())
|
||||
{
|
||||
auto &front_msg = messages_.front();
|
||||
messages_.pop_front();
|
||||
fun(front_msg);
|
||||
messages_.pop_front();
|
||||
}
|
||||
}
|
||||
} // namespace details
|
||||
|
@ -139,7 +139,7 @@ private:
|
||||
filename_t current_file = filename();
|
||||
if (filenames_q_.full())
|
||||
{
|
||||
auto &old_filename = filenames_q_.front();
|
||||
auto old_filename = std::move(filenames_q_.front());
|
||||
filenames_q_.pop_front();
|
||||
bool ok = remove_if_exists(old_filename) == 0;
|
||||
if (!ok)
|
||||
|
Loading…
Reference in New Issue
Block a user