Skip to content

Commit

Permalink
fix subtle
Browse files Browse the repository at this point in the history
  • Loading branch information
cssivision committed Apr 8, 2024
1 parent 47192fc commit 68e236d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ pub struct Local<T> {
}

impl<T> Local<T> {
/// Steals some items from local into another.
/// Steals some items from another into local.
fn steal(&self, length: usize, f: impl Fn() -> Option<T>) {
// Half of `src`'s length rounded up.
let mut count = (length + 1) / 2;
Expand Down Expand Up @@ -461,7 +461,7 @@ impl<T> Local<T> {
let tail = self.tail.load(Ordering::Acquire);

let length = tail.wrapping_sub(head);
if length < self.buffer.len() {
if length <= self.buffer.len() {
length
} else {
self.capacity
Expand Down

0 comments on commit 68e236d

Please sign in to comment.