Skip to content

Commit ddae4e7

Browse files
authored
Avoid make_optional
1 parent bf9ece3 commit ddae4e7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/include/llvm/ADT/DenseMapInfo.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,9 @@ template <typename T> struct DenseMapInfo<std::optional<T>> {
326326
using Optional = std::optional<T>;
327327
using Info = DenseMapInfo<T>;
328328

329-
static inline Optional getEmptyKey() {
330-
return std::make_optional(Info::getEmptyKey());
331-
}
329+
static inline Optional getEmptyKey() { return {Info::getEmptyKey()}; }
332330

333-
static inline Optional getTombstoneKey() {
334-
return std::make_optional(Info::getTombstoneKey());
335-
}
331+
static inline Optional getTombstoneKey() { return {Info::getTombstoneKey()}; }
336332

337333
static unsigned getHashValue(const Optional &OptionalVal) {
338334
return detail::combineHashValue(

0 commit comments

Comments
 (0)