Redundant checking of STL container element
As of C++ specification size_type erase( const key_type& key ); removes the element (if one exists). There is no need to perform the check twice. Change-Id: I4b057c08526abc7c2a483a60f9e166e4d8f56a74
This commit is contained in:
parent
8524faddd3
commit
bb8bce932e
1 changed files with 1 additions and 3 deletions
|
@ -1220,9 +1220,7 @@ static int PerformCommandFree(CommandParameters& params) {
|
||||||
|
|
||||||
const std::string& id = params.tokens[params.cpos++];
|
const std::string& id = params.tokens[params.cpos++];
|
||||||
|
|
||||||
if (stash_map.find(id) != stash_map.end()) {
|
stash_map.erase(id);
|
||||||
stash_map.erase(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.createdstash || params.canwrite) {
|
if (params.createdstash || params.canwrite) {
|
||||||
return FreeStash(params.stashbase, id);
|
return FreeStash(params.stashbase, id);
|
||||||
|
|
Loading…
Reference in a new issue