diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-01-18 00:38:04 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-01-18 00:38:04 +0000 |
commit | 470fd4af9b548e817ac1482da550e1ea3e9974c8 (patch) | |
tree | 9871e77376b45de362b20fe497d0584bdd8d2813 | |
parent | 42c3dcfbb032a2acde040463afa1a751f8c9e421 (diff) | |
download | external_llvm-470fd4af9b548e817ac1482da550e1ea3e9974c8.zip external_llvm-470fd4af9b548e817ac1482da550e1ea3e9974c8.tar.gz external_llvm-470fd4af9b548e817ac1482da550e1ea3e9974c8.tar.bz2 |
Reverted implementation of ImmutableMap::find() to return a TreeTy* instead of
an iterator, since the implementation returned an iterator that pointed to a
different node! Renamed this implementation to SlimFind() so that users do not
expect it to return an iterator (it is a more efficient implementation than
returning an iterator if the user just wants to find the value of a key).
Added a FIXME to implement ImmutableMap::find() that returns an iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46150 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/ImmutableMap.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/ADT/ImmutableMap.h b/include/llvm/ADT/ImmutableMap.h index 273a297..de1c587 100644 --- a/include/llvm/ADT/ImmutableMap.h +++ b/include/llvm/ADT/ImmutableMap.h @@ -188,15 +188,17 @@ public: iterator begin() const { return iterator(Root); } iterator end() const { return iterator(); } - iterator find(key_type_ref K) const { + TreeTy* SlimFind(key_type_ref K) const { if (Root) { TreeTy* T = Root->find(K); - if (T) return iterator(T); + if (T) return T; } - return iterator(); + return NULL; } + // FIXME: Add 'find' that returns an iterator instead of a TreeTy*. + //===--------------------------------------------------===// // Utility methods. //===--------------------------------------------------===// |