aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/ImmutableSet.h
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-02-01 07:32:52 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-02-01 07:32:52 +0000
commitddba25ab702063e61430bf9d294ba70fb5fdb046 (patch)
tree8085336326bdf601cc59d616113c2e39ed33c7b0 /include/llvm/ADT/ImmutableSet.h
parent0a4fd46d9e0517cbe14f38f52f186094272f8c41 (diff)
downloadexternal_llvm-ddba25ab702063e61430bf9d294ba70fb5fdb046.zip
external_llvm-ddba25ab702063e61430bf9d294ba70fb5fdb046.tar.gz
external_llvm-ddba25ab702063e61430bf9d294ba70fb5fdb046.tar.bz2
Simplify code. We can compare TNew with T in one batch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/ImmutableSet.h')
-rw-r--r--include/llvm/ADT/ImmutableSet.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/include/llvm/ADT/ImmutableSet.h b/include/llvm/ADT/ImmutableSet.h
index ac06a40..dcead4c 100644
--- a/include/llvm/ADT/ImmutableSet.h
+++ b/include/llvm/ADT/ImmutableSet.h
@@ -581,25 +581,14 @@ public:
continue;
// We found a collision. Perform a comparison of Contents('T')
- // with Contents('L')+'V'+Contents('R').
+ // with Contents('TNew')
typename TreeTy::iterator TI = T->begin(), TE = T->end();
- // First compare Contents('L') with the (initial) contents of T.
- if (!CompareTreeWithSection(TNew->getLeft(), TI, TE))
- continue;
-
- // Now compare the new data element.
- if (TI == TE || !TI->ElementEqual(TNew->getValue()))
- continue;
-
- ++TI;
-
- // Now compare the remainder of 'T' with 'R'.
- if (!CompareTreeWithSection(TNew->getRight(), TI, TE))
+ if (!CompareTreeWithSection(TNew, TI, TE))
continue;
if (TI != TE)
- continue; // Contents('R') did not match suffix of 'T'.
+ continue; // T has more contents than TNew.
// Trees did match! Return 'T'.
return T;