From 2bb29f71bc45e11cf51f175334d05feeee6f6a11 Mon Sep 17 00:00:00 2001 From: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com> Date: Wed, 19 Feb 2025 21:04:58 -0600 Subject: [PATCH] Use a slightly clearer name Co-authored-by: 9291Sam --- src/platform/dbghelp_utils.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/platform/dbghelp_utils.cpp b/src/platform/dbghelp_utils.cpp index e166d6a..0f97521 100644 --- a/src/platform/dbghelp_utils.cpp +++ b/src/platform/dbghelp_utils.cpp @@ -105,16 +105,16 @@ namespace detail { // SymInitialize being called twice. // DuplicateHandle requires the PROCESS_DUP_HANDLE access right. If for some reason DuplicateHandle we fall back // to calling SymInitialize on the process handle. - optional duplicate_handle_errored; + optional maybe_duplicate_handle_error_code; if(!DuplicateHandle(proc, proc, proc, &duplicated_handle.get(), 0, FALSE, DUPLICATE_SAME_ACCESS)) { - duplicate_handle_errored = GetLastError(); + maybe_duplicate_handle_error_code = GetLastError(); } - if(!SymInitialize(duplicate_handle_errored ? proc : duplicated_handle.get(), NULL, TRUE)) { - if(duplicate_handle_errored) { + if(!SymInitialize(maybe_duplicate_handle_error_code ? proc : duplicated_handle.get(), NULL, TRUE)) { + if(maybe_duplicate_handle_error_code) { throw internal_error( "SymInitialize failed with error code {} after DuplicateHandle failed with error code {}", GetLastError(), - duplicate_handle_errored.unwrap() + maybe_duplicate_handle_error_code.unwrap() ); } else { throw internal_error("SymInitialize failed with error code {}", GetLastError()); @@ -122,8 +122,8 @@ namespace detail { } auto info = dbghelp_syminit_info::make_owned( - duplicate_handle_errored ? proc : exchange(duplicated_handle.get(), nullptr), - duplicate_handle_errored ? false : true // looks funny but I think it's a little more expressive + maybe_duplicate_handle_error_code ? proc : exchange(duplicated_handle.get(), nullptr), + !maybe_duplicate_handle_error_code ); // either cache and return a view or return the owning wrapper if(get_cache_mode() == cache_mode::prioritize_speed) {