[Lldb-commits] [lldb] 33625f7 - [lldb] Use std::optional::value_or (NFC) (#151629)

via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 1 07:02:10 PDT 2025


Author: Kazu Hirata
Date: 2025-08-01T07:02:06-07:00
New Revision: 33625f7cb395a3664b81f1327868828d2e51fa46

URL: https://github.com/llvm/llvm-project/commit/33625f7cb395a3664b81f1327868828d2e51fa46
DIFF: https://github.com/llvm/llvm-project/commit/33625f7cb395a3664b81f1327868828d2e51fa46.diff

LOG: [lldb] Use std::optional::value_or (NFC) (#151629)

Added: 
    

Modified: 
    lldb/source/Interpreter/OptionArgParser.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Interpreter/OptionArgParser.cpp b/lldb/source/Interpreter/OptionArgParser.cpp
index 616f6e3dc8820..170f65ad80a74 100644
--- a/lldb/source/Interpreter/OptionArgParser.cpp
+++ b/lldb/source/Interpreter/OptionArgParser.cpp
@@ -161,7 +161,7 @@ lldb::addr_t OptionArgParser::ToRawAddress(const ExecutionContext *exe_ctx,
                                            lldb::addr_t fail_value,
                                            Status *error_ptr) {
   std::optional<lldb::addr_t> maybe_addr = DoToAddress(exe_ctx, s, error_ptr);
-  return maybe_addr ? *maybe_addr : fail_value;
+  return maybe_addr.value_or(fail_value);
 }
 
 lldb::addr_t OptionArgParser::ToAddress(const ExecutionContext *exe_ctx,


        


More information about the lldb-commits mailing list