Trivially replace `wake_by_ref` with `wake`.
What changed, and why it matters
This is a one-line performance micro-optimization in Rust's async waker code. It changes a waker call from 'wake without consuming' to 'wake and consume' because the code already owns the waker and no longer needs it. There is no security relevance.
No action needed. This is a benign optimization.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit replaces Waker::wake_by_ref with Waker::wake in lightning/src/util/wakers.rs. Both methods perform the same logical operation of notifying an async task to continue; the only difference is that wake takes ownership of the Waker and may avoid a clone, while wake_by_ref borrows it. Since the code drains owned wakers from a vector and discards them immediately after, wake is the idiomatic and potentially more efficient choice. This is a pure refactor with no functional or security change.
Changed components
lightning/src/util/wakers.rsInspect captured patch +1 / −1
diff --git a/lightning/src/util/wakers.rs b/lightning/src/util/wakers.rs
index e7553d9..a84d909 100644
--- a/lightning/src/util/wakers.rs
+++ b/lightning/src/util/wakers.rs
@@ -146,7 +146,7 @@ fn complete_future(this: &Arc<Mutex<FutureState>>) -> bool {
state.callbacks_made = true;
}
for (_, waker) in state.std_future_callbacks.drain(..) {
- waker.0.wake_by_ref();
+ waker.0.wake();
}
for callback in state.callbacks_with_state.drain(..) {
(callback)(this);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.