From 09d65fe8a190fdd461be18c8f6be57a1c2a2b6f7 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 18 May 2025 07:34:20 -0700 Subject: [PATCH] [Support] Use std::optional::value_or (NFC) (#140436) --- llvm/lib/Support/TrieRawHashMap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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