diff --git a/llvm/lib/Support/TrieRawHashMap.cpp b/llvm/lib/Support/TrieRawHashMap.cpp index bb779fe87ae6..2719ab5b315e 100644 --- a/llvm/lib/Support/TrieRawHashMap.cpp +++ b/llvm/lib/Support/TrieRawHashMap.cpp @@ -333,8 +333,8 @@ ThreadSafeTrieRawHashMapBase::ThreadSafeTrieRawHashMapBase( std::optional NumRootBits, std::optional NumSubtrieBits) : ContentAllocSize(ContentAllocSize), ContentAllocAlign(ContentAllocAlign), ContentOffset(ContentOffset), - NumRootBits(NumRootBits ? *NumRootBits : DefaultNumRootBits), - NumSubtrieBits(NumSubtrieBits ? *NumSubtrieBits : DefaultNumSubtrieBits), + NumRootBits(NumRootBits.value_or(DefaultNumRootBits)), + NumSubtrieBits(NumSubtrieBits.value_or(DefaultNumSubtrieBits)), ImplPtr(nullptr) { // Assertion checks for reasonable configuration. The settings below are not // hard limits on most platforms, but a reasonable configuration should fall