mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-12 01:25:10 +00:00
Changed ImmutableMap::find to return an iterator instead of a pointer
to the tree node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46034 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -99,14 +99,6 @@ public:
|
|||||||
return Root ? Root->contains(K) : false;
|
return Root ? Root->contains(K) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
data_type* find(key_type_ref K) const {
|
|
||||||
if (Root) {
|
|
||||||
TreeTy* T = Root->find(K);
|
|
||||||
if (T) return &T->getValue().second;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator==(ImmutableMap RHS) const {
|
bool operator==(ImmutableMap RHS) const {
|
||||||
return Root && RHS.Root ? Root->isEqual(*RHS.Root) : Root == RHS.Root;
|
return Root && RHS.Root ? Root->isEqual(*RHS.Root) : Root == RHS.Root;
|
||||||
@@ -171,7 +163,7 @@ public:
|
|||||||
|
|
||||||
iterator() {}
|
iterator() {}
|
||||||
iterator(TreeTy* t) : itr(t) {}
|
iterator(TreeTy* t) : itr(t) {}
|
||||||
friend class ImmutableSet<ValT,ValInfo>;
|
friend class ImmutableMap;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline value_type_ref operator*() const { return itr->getValue(); }
|
inline value_type_ref operator*() const { return itr->getValue(); }
|
||||||
@@ -189,6 +181,15 @@ public:
|
|||||||
iterator begin() const { return iterator(Root); }
|
iterator begin() const { return iterator(Root); }
|
||||||
iterator end() const { return iterator(); }
|
iterator end() const { return iterator(); }
|
||||||
|
|
||||||
|
iterator find(key_type_ref K) const {
|
||||||
|
if (Root) {
|
||||||
|
TreeTy* T = Root->find(K);
|
||||||
|
if (T) return iterator(T);
|
||||||
|
}
|
||||||
|
|
||||||
|
return iterator();
|
||||||
|
}
|
||||||
|
|
||||||
//===--------------------------------------------------===//
|
//===--------------------------------------------------===//
|
||||||
// Utility methods.
|
// Utility methods.
|
||||||
//===--------------------------------------------------===//
|
//===--------------------------------------------------===//
|
||||||
|
Reference in New Issue
Block a user