Skip to content

Commit

Permalink
Remove unnecessary statements (Wesley)
Browse files Browse the repository at this point in the history
  • Loading branch information
SergiySW committed Mar 25, 2020
1 parent dfddb3d commit 9db2158
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nano/node/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,9 +890,9 @@ void nano::tcp_message_manager::put_message (nano::tcp_message_item const & item
{
{
nano::unique_lock<std::mutex> lock (mutex);
if (entries.size () > max_entries && !stopped)
while (entries.size () > max_entries && !stopped)
{
condition.wait (lock, [& stopped = stopped, &entries = entries, &max_entries = max_entries] { return stopped || entries.size () < max_entries; });
condition.wait (lock);
}
entries.push_back (item_a);
}
Expand All @@ -902,9 +902,9 @@ void nano::tcp_message_manager::put_message (nano::tcp_message_item const & item
nano::tcp_message_item nano::tcp_message_manager::get_message ()
{
nano::unique_lock<std::mutex> lock (mutex);
if (entries.empty () && !stopped)
while (entries.empty () && !stopped)
{
condition.wait (lock, [& stopped = stopped, &entries = entries] { return stopped || !entries.empty (); });
condition.wait (lock);
}
if (!entries.empty ())
{
Expand Down

0 comments on commit 9db2158

Please sign in to comment.