aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <sunfish@google.com>2014-02-18 16:36:27 -0800
committerDan Gohman <sunfish@google.com>2014-02-25 11:58:56 -0800
commita1df0ec9355e389c9152ddee8798f5774feb1f4e (patch)
treeb1c0b8d23f5348e97688de8b0ab37e69ecf4b22f
parentfb66cddee6d75d611176ba8ef768959ce96f112e (diff)
Minor code simplifications.
-rw-r--r--lib/Target/JSBackend/Relooper.cpp6
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;