Skip to content

Commit dd115ba

Browse files
committedSep 19, 2019
Auto merge of #64600 - scottmcm:no-slice-tryfold-unroll, r=<try>
[DO NOT MERGE] Experiment with removing unrolling from slice::Iter::try_fold For context see #64572 (comment) r? @scottmcm
2 parents eceec57 + 38d8c8d commit dd115ba

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

‎src/libcore/slice/mod.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -3187,12 +3187,13 @@ macro_rules! iterator {
31873187
// manual unrolling is needed when there are conditional exits from the loop
31883188
let mut accum = init;
31893189
unsafe {
3190-
while len!(self) >= 4 {
3191-
accum = f(accum, next_unchecked!(self))?;
3192-
accum = f(accum, next_unchecked!(self))?;
3193-
accum = f(accum, next_unchecked!(self))?;
3194-
accum = f(accum, next_unchecked!(self))?;
3195-
}
3190+
// REMOVED AS AN EXPERIMENT; DO NOT MERGE
3191+
// while len!(self) >= 4 {
3192+
// accum = f(accum, next_unchecked!(self))?;
3193+
// accum = f(accum, next_unchecked!(self))?;
3194+
// accum = f(accum, next_unchecked!(self))?;
3195+
// accum = f(accum, next_unchecked!(self))?;
3196+
// }
31963197
while !is_empty!(self) {
31973198
accum = f(accum, next_unchecked!(self))?;
31983199
}

0 commit comments

Comments
 (0)
Please sign in to comment.