Skip to content

Commit

Permalink
Address reviewer feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <michael@openrobotics.org>
  • Loading branch information
mjcarroll committed Nov 15, 2021
1 parent f5097ce commit 7e8b1a0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Console.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*
*/
#include <map>
#include <string>
#include <sstream>
#include <unordered_map>

#include <ignition/common/Console.hh>
#include <ignition/common/config.hh>
Expand Down Expand Up @@ -123,12 +123,7 @@ std::lock_guard<std::mutex> BufferLock(std::uintptr_t _bufferId)
if(nullptr == kSyncMutex)
kSyncMutex = new std::unordered_map<uintptr_t, std::mutex>();

if (!kSyncMutex->count(_bufferId))
{
kSyncMutex->operator[](_bufferId);
}

return std::lock_guard<std::mutex>(kSyncMutex->at(_bufferId));
return std::lock_guard<std::mutex>(kSyncMutex->operator[](_bufferId));
}

/////////////////////////////////////////////////
Expand Down

0 comments on commit 7e8b1a0

Please sign in to comment.