Skip to content

Commit 8bfd053

Browse files
kazutakahiratamahesh-attarde
authored andcommitted
[ADT] Use DenseMap::contains in EquivalenceClasses.h (NFC) (llvm#161120)
While I am at it, this patch adds [[nodiscard]].
1 parent 21b35db commit 8bfd053

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/ADT/EquivalenceClasses.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ template <class ElemTy> class EquivalenceClasses {
180180
}
181181

182182
/// Returns true if \p V is contained an equivalence class.
183-
bool contains(const ElemTy &V) const {
184-
return TheMapping.find(V) != TheMapping.end();
183+
[[nodiscard]] bool contains(const ElemTy &V) const {
184+
return TheMapping.contains(V);
185185
}
186186

187187
/// getLeaderValue - Return the leader for the specified value that is in the

0 commit comments

Comments
 (0)