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:
Mikhail Lappo 2017-03-23 17:16:17 +01:00
parent 8524faddd3
commit bb8bce932e

View file

@ -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);