mirror of
https://github.com/roc-lang/roc.git
synced 2024-10-04 14:17:28 +03:00
turn a few while loops into for loops for clarity
This commit is contained in:
parent
f9abfcbb16
commit
7254122d30
@ -1187,14 +1187,9 @@ fn cross_merge(
|
||||
break;
|
||||
|
||||
// Large enough to warrent a two way merge.
|
||||
var loops: usize = 8;
|
||||
while (true) {
|
||||
for (0..8) |_| {
|
||||
head_branchless_merge(&dest_head, &left_head, &right_head, cmp, cmp_data, element_width, copy);
|
||||
tail_branchless_merge(&dest_tail, &left_tail, &right_tail, cmp, cmp_data, element_width, copy);
|
||||
|
||||
loops -= 1;
|
||||
if (loops == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1811,8 +1806,7 @@ fn parity_merge(
|
||||
}
|
||||
head_branchless_merge(&dest_head, &left_head, &right_head, cmp, cmp_data, element_width, copy);
|
||||
|
||||
var ll = left_len - 1;
|
||||
while (ll != 0) : (ll -= 1) {
|
||||
for (0..(left_len - 1)) |_| {
|
||||
head_branchless_merge(&dest_head, &left_head, &right_head, cmp, cmp_data, element_width, copy);
|
||||
tail_branchless_merge(&dest_tail, &left_tail, &right_tail, cmp, cmp_data, element_width, copy);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user