Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions llvm/include/llvm/ADT/DenseSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ class DenseSetImpl {

void clear() { TheMap.clear(); }

/// Return 1 if the specified key is in the set, 0 otherwise.
size_type count(const_arg_type_t<ValueT> V) const { return TheMap.count(V); }

bool erase(const ValueT &V) { return TheMap.erase(V); }

void swap(DenseSetImpl &RHS) { TheMap.swap(RHS.TheMap); }
Expand Down Expand Up @@ -169,8 +166,13 @@ class DenseSetImpl {
}

/// Check if the set contains the given element.
bool contains(const_arg_type_t<ValueT> V) const {
return TheMap.find(V) != TheMap.end();
[[nodiscard]] bool contains(const_arg_type_t<ValueT> V) const {
return TheMap.contains(V);
}

/// Return 1 if the specified key is in the set, 0 otherwise.
[[nodiscard]] size_type count(const_arg_type_t<ValueT> V) const {
return TheMap.count(V);
}

/// Alternative version of find() which allows a different, and possibly less
Expand Down
Loading