diff options
author | Dan Gohman <sunfish@google.com> | 2014-02-18 16:36:27 -0800 |
---|---|---|
committer | Dan Gohman <sunfish@google.com> | 2014-02-25 11:58:56 -0800 |
commit | a1df0ec9355e389c9152ddee8798f5774feb1f4e (patch) | |
tree | b1c0b8d23f5348e97688de8b0ab37e69ecf4b22f /lib | |
parent | fb66cddee6d75d611176ba8ef768959ce96f112e (diff) |
Minor code simplifications.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/JSBackend/Relooper.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Target/JSBackend/Relooper.cpp b/lib/Target/JSBackend/Relooper.cpp index 204986da72..f09c54adf8 100644 --- a/lib/Target/JSBackend/Relooper.cpp +++ b/lib/Target/JSBackend/Relooper.cpp @@ -13,8 +13,8 @@ typedef std::string ministring; #endif -template <class T, class U> bool contains(const T& container, const U& contained) { - return container.find(contained) != container.end(); +template <class T, class U> static bool contains(const T& container, const U& contained) { + return container.count(contained); } #if DEBUG @@ -646,7 +646,7 @@ void Relooper::Calculate(Block *Entry) { Block *Curr = *iter; for (BlockBranchMap::iterator iter = Curr->BranchesOut.begin(); iter != Curr->BranchesOut.end(); iter++) { Block *Target = iter->first; - if (Hoisted.find(Target) == Hoisted.end() && NextEntries.find(Target) == NextEntries.end()) { + if (!contains(Hoisted, Target) && !contains(NextEntries, Target)) { // abort this hoisting abort = true; break; |