forked from OSchip/llvm-project
Add DenseMap::lookup:
/// lookup - Return the entry for the specified key, or a default /// constructed value if no such entry exists. llvm-svn: 55523
This commit is contained in:
parent
c83e755d78
commit
c70fa60b5e
|
@ -189,6 +189,15 @@ public:
|
|||
return end();
|
||||
}
|
||||
|
||||
/// lookup - Return the entry for the specified key, or a default
|
||||
/// constructed value if no such entry exists.
|
||||
ValueT lookup(const KeyT &Val) const {
|
||||
BucketT *TheBucket;
|
||||
if (LookupBucketFor(Val, TheBucket))
|
||||
return TheBucket->second;
|
||||
return ValueT();
|
||||
}
|
||||
|
||||
std::pair<iterator, bool> insert(const std::pair<KeyT, ValueT> &KV) {
|
||||
BucketT *TheBucket;
|
||||
if (LookupBucketFor(KV.first, TheBucket))
|
||||
|
|
Loading…
Reference in New Issue