Skip to content

Commit d3e263f

Browse files
kazutakahiratagithub-actions[bot]
authored andcommitted
Automerge: [ADT] Refactor DenseSet::insert (NFC) (#157324)
DenseMap::try_emplace can default-construct DenseSetEmptyKey, so we don't need to pass Empty on our own.
2 parents d324637 + 13647d8 commit d3e263f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/include/llvm/ADT/DenseSet.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,11 @@ class DenseSetImpl {
192192
void erase(const_iterator CI) { return TheMap.erase(CI.I); }
193193

194194
std::pair<iterator, bool> insert(const ValueT &V) {
195-
detail::DenseSetEmpty Empty;
196-
return TheMap.try_emplace(V, Empty);
195+
return TheMap.try_emplace(V);
197196
}
198197

199198
std::pair<iterator, bool> insert(ValueT &&V) {
200-
detail::DenseSetEmpty Empty;
201-
return TheMap.try_emplace(std::move(V), Empty);
199+
return TheMap.try_emplace(std::move(V));
202200
}
203201

204202
/// Alternative version of insert that uses a different (and possibly less

0 commit comments

Comments
 (0)