Skip to content

Commit 730fcfc

Browse files
committed
Guard against `resize_with not being efficient.
Signed-off-by: Moritz Hoffmann <[email protected]>
1 parent d3e47a9 commit 730fcfc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

timely/src/dataflow/channels/pushers/exchange.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ where
5151
for<'a> H: FnMut(&<CB::Container as Container>::Item<'a>) -> u64,
5252
{
5353
fn partition(&mut self, container: &mut CB::Container, time: &T, pushers: &mut [P]) {
54-
self.builders.resize_with(pushers.len(), Default::default);
54+
if self.builders.len() != pushers.len() {
55+
self.builders.resize_with(pushers.len(), Default::default);
56+
}
5557
if pushers.len().is_power_of_two() {
5658
let mask = (pushers.len() - 1) as u64;
5759
for datum in container.drain() {

0 commit comments

Comments
 (0)