forked from OSchip/llvm-project
Make find return the appropriate iterator/const_iterator
llvm-svn: 34137
This commit is contained in:
parent
733a841633
commit
3541003208
|
@ -108,12 +108,18 @@ public:
|
||||||
return LookupBucketFor(Val, TheBucket);
|
return LookupBucketFor(Val, TheBucket);
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator find(const KeyT &Val) const {
|
iterator find(const KeyT &Val) {
|
||||||
BucketT *TheBucket;
|
BucketT *TheBucket;
|
||||||
if (LookupBucketFor(Val, TheBucket))
|
if (LookupBucketFor(Val, TheBucket))
|
||||||
return iterator(TheBucket, Buckets+NumBuckets);
|
return iterator(TheBucket, Buckets+NumBuckets);
|
||||||
return end();
|
return end();
|
||||||
}
|
}
|
||||||
|
const_iterator find(const KeyT &Val) const {
|
||||||
|
BucketT *TheBucket;
|
||||||
|
if (LookupBucketFor(Val, TheBucket))
|
||||||
|
return const_iterator(TheBucket, Buckets+NumBuckets);
|
||||||
|
return end();
|
||||||
|
}
|
||||||
|
|
||||||
bool insert(const std::pair<KeyT, ValueT> &KV) {
|
bool insert(const std::pair<KeyT, ValueT> &KV) {
|
||||||
BucketT *TheBucket;
|
BucketT *TheBucket;
|
||||||
|
@ -334,7 +340,7 @@ class DenseMapConstIterator : public DenseMapIterator<KeyT, ValueT, KeyInfoT> {
|
||||||
public:
|
public:
|
||||||
DenseMapConstIterator(const std::pair<KeyT, ValueT> *Pos,
|
DenseMapConstIterator(const std::pair<KeyT, ValueT> *Pos,
|
||||||
const std::pair<KeyT, ValueT> *E)
|
const std::pair<KeyT, ValueT> *E)
|
||||||
: DenseMapIterator<KeyT, ValueT>(Pos, E) {
|
: DenseMapIterator<KeyT, ValueT, KeyInfoT>(Pos, E) {
|
||||||
}
|
}
|
||||||
const std::pair<KeyT, ValueT> &operator*() const {
|
const std::pair<KeyT, ValueT> &operator*() const {
|
||||||
return *this->Ptr;
|
return *this->Ptr;
|
||||||
|
|
Loading…
Reference in New Issue