alamb commented on code in PR #11324:
URL: https://github.com/apache/arrow-rs/pull/11324#discussion_r4189045719
##########
arrow-ord/src/partition.rs:
##########
@@ -143,10 +143,14 @@ pub fn partition(columns: &[ArrayRef]) ->
Result<Partitions, ArrowError> {
}
let acc = find_boundaries(&columns[0])?;
- let acc = columns
- .iter()
- .skip(1)
- .try_fold(acc, |acc, c| find_boundaries(c.as_ref()).map(|b| &acc |
&b))?;
+ let acc = columns.iter().skip(1).try_fold(acc, |mut acc, c| {
+ find_boundaries(c.as_ref()).map(|b| {
+ // Do OrAssign to try to reuse the existing buffer if possible
+ acc |= &b;
Review Comment:
🧑🍳 👌
Very nice
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]