Skip to content

Commit

Permalink
🔧 Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas Gilg <[email protected]>
  • Loading branch information
Schneegans and JonasGilg authored Sep 29, 2022
1 parent d00a3e5 commit 21d6af0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cs-utils/ObservableMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class ObservableMap {

/// Inserts a new element into the container if there is no element with the key in the container.
void insert(K key, V value) {
auto res = mMap.emplace(std::move(key), std::move(value));
auto [entry, success] = mMap.emplace(std::move(key), std::move(value));

if (res.second) {
mOnAdd.emit(res.first->first, res.first->second);
if (success) {
mOnAdd.emit(entry->first, entry->second);
}
}

Expand Down

0 comments on commit 21d6af0

Please sign in to comment.