update_engine: remove redundant utils functions utils::MapContainsKey and utils::SetContainsKey are the same function and could be unified with more general templating, but that would just be a reimplementation of base::ContainsKey so we can just use that instead. Additionally, base::ContainsValue can be used in place of utils::VectorContainsValue. BUG=None TEST=unit tests Change-Id: Ia8fee68ca8d6a87d232f89380c1e4144b598fad9 Reviewed-on: https://chromium-review.googlesource.com/882455 Commit-Ready: Eric Caruso <[email protected]> Tested-by: Eric Caruso <[email protected]> Reviewed-by: Amin Hassani <[email protected]> Reviewed-by: Alex Deymo <[email protected]>
diff --git a/payload_generator/tarjan.cc b/payload_generator/tarjan.cc index 98e29f9..d99ae12 100644 --- a/payload_generator/tarjan.cc +++ b/payload_generator/tarjan.cc
@@ -19,8 +19,7 @@ #include <vector> #include <base/logging.h> - -#include "update_engine/common/utils.h" +#include <base/stl_util.h> using std::min; using std::vector; @@ -59,7 +58,7 @@ Tarjan(vertex_next, graph); (*graph)[vertex].lowlink = min((*graph)[vertex].lowlink, (*graph)[vertex_next].lowlink); - } else if (utils::VectorContainsValue(stack_, vertex_next)) { + } else if (base::ContainsValue(stack_, vertex_next)) { (*graph)[vertex].lowlink = min((*graph)[vertex].lowlink, (*graph)[vertex_next].index); } @@ -73,7 +72,7 @@ component.push_back(other_vertex); } while (other_vertex != vertex && !stack_.empty()); - if (utils::VectorContainsValue(component, required_vertex_)) { + if (base::ContainsValue(component, required_vertex_)) { components_.resize(components_.size() + 1); component.swap(components_.back()); }