Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions core/compiler/src/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ impl Solver {
let id = self.next_constraint;
self.next_constraint += 1;
for (_, var) in &expr.coeffs {
self.var_to_constraints
.entry(*var)
.or_insert(IndexSet::new())
.insert(id);
self.var_to_constraints.entry(*var).or_default().insert(id);
}
self.constraints.insert(id, expr);
// Use explicit stack in heap-allocated vector to avoid stack overflow.
Expand Down
10 changes: 9 additions & 1 deletion core/compiler/src/std/lib.ar
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ fn array2(r: Rect, nx: Int, ny: Int, xpitch: Float, ypitch: Float) -> Rect {
fn max_array(r: Rect, w: Float, h: Float, xpitch: Float, ypitch: Float) -> Rect {
let nx = (((w - r.w) / xpitch) as Int + 1);
let ny = (((h - r.h) / ypitch) as Int + 1);
#scope0 array2(r, nx, ny, xpitch, ypitch)
if nx >= 1 {
if ny >= 1 {
#scope0 array2(r, nx, ny, xpitch, ypitch)
} else {
crect(w=0., h=0.)
}
} else {
crect(w=0., h=0.)
}
}

fn eq_rect(r1: Rect, r2: Rect) {
Expand Down