diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2023-12-22 16:44:34 -0700 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2024-01-04 11:02:14 -0700 |
| commit | a82a2105fd1b1a99bddb835ed1d9dbf2e2a5c56f (patch) | |
| tree | cbf61cb01a6d2b1102a2465132d2d2df22ba3900 /rust/src/llil/function.rs | |
| parent | 80b07dfa158bb093cc93e602363655b62ae595f8 (diff) | |
Use unwrap_or_else to avoid running error path code when there isn't an error
Diffstat (limited to 'rust/src/llil/function.rs')
| -rw-r--r-- | rust/src/llil/function.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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); |
