Skip to content

Commit c8b3e81

Browse files
authored
Avoiding else after return
1 parent f7a244c commit c8b3e81

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/include/llvm/ADT/DenseMapInfo.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,10 @@ struct DenseMapInfo<std::optional<T>> {
341341
}
342342

343343
static bool isEqual(const Optional &LHS, const Optional &RHS) {
344-
if (LHS.has_value() && RHS.has_value()) {
344+
if (LHS && RHS) {
345345
return Info::isEqual(LHS.value(), RHS.value());
346-
} else if (!LHS.has_value() && !RHS.has_value()) {
347-
return true;
348346
}
349-
return false;
347+
return !LHS && !RHS;
350348
}
351349
};
352350
} // end namespace llvm

0 commit comments

Comments
 (0)