Skip to content

Commit 6e06b9c

Browse files
[ADT] Delegate to DenseMap::find_as (NFC) (#155974)
DenseMap::find is a special case of DenseMap::find_as with a restriction on the key type.
1 parent 8a65c4f commit 6e06b9c

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

llvm/include/llvm/ADT/DenseMap.h

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,8 @@ class DenseMapBase : public DebugEpochBase {
174174
return contains(Val) ? 1 : 0;
175175
}
176176

177-
iterator find(const_arg_type_t<KeyT> Val) {
178-
if (BucketT *Bucket = doFind(Val))
179-
return makeIterator(
180-
Bucket, shouldReverseIterate<KeyT>() ? getBuckets() : getBucketsEnd(),
181-
*this, true);
182-
return end();
183-
}
184-
const_iterator find(const_arg_type_t<KeyT> Val) const {
185-
if (const BucketT *Bucket = doFind(Val))
186-
return makeConstIterator(
187-
Bucket, shouldReverseIterate<KeyT>() ? getBuckets() : getBucketsEnd(),
188-
*this, true);
189-
return end();
190-
}
177+
iterator find(const_arg_type_t<KeyT> Val) { return find_as(Val); }
178+
const_iterator find(const_arg_type_t<KeyT> Val) const { return find_as(Val); }
191179

192180
/// Alternate version of find() which allows a different, and possibly
193181
/// less expensive, key type.

0 commit comments

Comments
 (0)