Skip to content

Commit

Permalink
[WASimClient] Avoid unnecessary map lookup after emplace call.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpaperno committed Mar 1, 2024
1 parent 03753d8 commit 5e1d663
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/WASimClient/WASimClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1087,8 +1087,7 @@ class WASimClient::Private

if (isNewRequest) {
unique_lock lock{mtxRequests};
requests.try_emplace(req.requestId, req, nextDefId++);
tr = &requests.at(req.requestId);
tr = &requests.try_emplace(req.requestId, req, nextDefId++).first->second;
}
else {
if (actualValSize > tr->dataSize) {
Expand Down

0 comments on commit 5e1d663

Please sign in to comment.