Skip to content

Commit 5d00573

Browse files
committed
don't allocate empty streams in Task::batch
1 parent d188d6f commit 5d00573

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

runtime/src/task.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ impl<T> Task<T> {
108108
}
109109

110110
Self {
111-
stream: Some(boxed_stream(select_all)),
111+
stream: if select_all.is_empty() {
112+
None
113+
} else {
114+
Some(boxed_stream(select_all))
115+
},
112116
units,
113117
}
114118
}

0 commit comments

Comments
 (0)