Skip to content

Commit

Permalink
Revert "ref(rust): Do not do extra work when merging if not needed (#…
Browse files Browse the repository at this point in the history
…5294)"

This reverts commit 0409b3f.

Co-authored-by: untitaker <837573+untitaker@users.noreply.github.com>
  • Loading branch information
getsentry-bot and untitaker committed Jan 4, 2024
1 parent 822e660 commit 5ce9183
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions rust_snuba/rust_arroyo/src/processing/strategies/reduce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,8 @@ impl<T, TResult> BatchState<T, TResult> {

let tmp = self.value.take().unwrap();
let payload = message.into_payload();
let batch_size = (self.compute_batch_size)(&payload);

if batch_size > 0 {
self.message_count += batch_size;
self.value = Some((self.accumulator)(tmp, payload));
}
self.message_count += (self.compute_batch_size)(&payload);
self.value = Some((self.accumulator)(tmp, payload));
}
}

Expand Down

0 comments on commit 5ce9183

Please sign in to comment.