Fix infinite loop in H/VJoins without expanding sections
This commit is contained in:
parent
f1899ab295
commit
1e4bbc6eab
1 changed files with 5 additions and 0 deletions
|
|
@ -23,6 +23,11 @@ impl Segment {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expand(amounts: &mut [(u16, bool)], total: u16) {
|
fn expand(amounts: &mut [(u16, bool)], total: u16) {
|
||||||
|
let any_expanding = amounts.iter().any(|(_, expanding)| *expanding);
|
||||||
|
if !any_expanding {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Weirdly, rustc needs this type annotation while rust-analyzer manages to
|
// Weirdly, rustc needs this type annotation while rust-analyzer manages to
|
||||||
// derive the correct type in an inlay hint.
|
// derive the correct type in an inlay hint.
|
||||||
let actual: u16 = amounts.iter().map(|(a, _)| *a).sum();
|
let actual: u16 = amounts.iter().map(|(a, _)| *a).sum();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue