From a82a2105fd1b1a99bddb835ed1d9dbf2e2a5c56f Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Fri, 22 Dec 2023 16:44:34 -0700 Subject: Use unwrap_or_else to avoid running error path code when there isn't an error --- rust/src/llil/function.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust/src/llil/function.rs') diff --git a/rust/src/llil/function.rs b/rust/src/llil/function.rs index 20d2cb04..6d561731 100644 --- a/rust/src/llil/function.rs +++ b/rust/src/llil/function.rs @@ -103,7 +103,7 @@ where use binaryninjacore_sys::BNLowLevelILGetInstructionStart; let loc: Location = loc.into(); - let arch_handle = loc.arch.unwrap_or(*self.arch().as_ref()); + let arch_handle = loc.arch.unwrap_or_else(|| *self.arch().as_ref()); unsafe { let instr_idx = BNLowLevelILGetInstructionStart(self.handle, arch_handle.0, loc.addr); -- cgit v1.3.1