From 9ab562554ba00523a6769cc22c14dc5e3651ae04 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:41:16 +0200 Subject: [PATCH] docs: is_static doc driveby --- crates/interpreter/src/interpreter/stack.rs | 6 ++++-- crates/interpreter/src/interpreter_action/call_inputs.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/interpreter/src/interpreter/stack.rs b/crates/interpreter/src/interpreter/stack.rs index 4e0512f53d6..de30b5478df 100644 --- a/crates/interpreter/src/interpreter/stack.rs +++ b/crates/interpreter/src/interpreter/stack.rs @@ -275,9 +275,11 @@ impl Stack { } // SAFETY: `n` and `n_m` are checked to be within bounds, and they don't overlap. unsafe { - // NOTE: `mem::swap` performs better than `slice::swap`/`ptr::swap`, as they cannot - // assume that the pointers are non-overlapping when we know they are not. + // NOTE: `mem::swap` is more efficient than `slice::swap` or `ptr::swap` because it + // operates under the assumption that the pointers do not overlap, + // which is a condition we know to be true in this context. let top = self.data.as_mut_ptr().add(len - 1); + #[allow(clippy::swap_ptr_to_ref)] // See above. core::mem::swap(&mut *top.sub(n), &mut *top.sub(n_m_index)); } Ok(()) diff --git a/crates/interpreter/src/interpreter_action/call_inputs.rs b/crates/interpreter/src/interpreter_action/call_inputs.rs index 196f7b1a6dc..8958b213ff1 100644 --- a/crates/interpreter/src/interpreter_action/call_inputs.rs +++ b/crates/interpreter/src/interpreter_action/call_inputs.rs @@ -36,7 +36,7 @@ pub struct CallInputs { /// /// Previously `context.scheme`. pub scheme: CallScheme, - /// Whether the call is initiated inside a static call. + /// Whether the call is, or is initiated inside a static call. pub is_static: bool, /// Whether the call is initiated from EOF bytecode. pub is_eof: bool,