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
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index efdfec1..12ca151 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -1220,9 +1220,7 @@
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) {
return FreeStash(params.stashbase, id);