mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
MapVector: Add lookup().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170527 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fdbeb057b8
commit
fc8657be34
@ -79,6 +79,11 @@ public:
|
||||
return Vector[I].second;
|
||||
}
|
||||
|
||||
ValueT lookup(const KeyT &Key) const {
|
||||
typename MapType::const_iterator Pos = Map.find(Key);
|
||||
return Pos == Map.end()? ValueT() : Vector[Pos->second].second;
|
||||
}
|
||||
|
||||
unsigned count(const KeyT &Key) const {
|
||||
typename MapType::const_iterator Pos = Map.find(Key);
|
||||
return Pos == Map.end()? 0 : 1;
|
||||
|
Loading…
Reference in New Issue
Block a user