Reduce double set lookups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230798 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2015-02-27 21:43:14 +00:00
parent 7c9c6ed761
commit 9f9dcf8046
3 changed files with 3 additions and 6 deletions

View File

@ -346,11 +346,10 @@ namespace {
/// Push BV onto BlockValueStack unless it's already in there.
/// Returns true on success.
bool pushBlockValue(const std::pair<BasicBlock *, Value *> &BV) {
if (BlockValueSet.count(BV))
if (!BlockValueSet.insert(BV).second)
return false; // It's already in the stack.
BlockValueStack.push(BV);
BlockValueSet.insert(BV);
return true;
}