mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-13 09:49:11 +03:00
Avoid an allocation
This commit is contained in:
parent
d0c6c06ca1
commit
7420276116
@ -1677,16 +1677,15 @@ fn constrain_typed_function_arguments(
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn attach_resolution_constraints(
|
||||
constraints: &mut Constraints,
|
||||
env: &mut Env,
|
||||
constraint: Constraint,
|
||||
) -> Constraint {
|
||||
let resolution_constrs = env.resolutions_to_make.drain(..).map(Constraint::Resolve);
|
||||
let all_constrs: Vec<_> = std::iter::once(constraint)
|
||||
.chain(resolution_constrs)
|
||||
.collect();
|
||||
constraints.and_constraint(all_constrs)
|
||||
let resolution_constrs =
|
||||
constraints.and_constraint(env.resolutions_to_make.drain(..).map(Constraint::Resolve));
|
||||
constraints.and_constraint([constraint, resolution_constrs])
|
||||
}
|
||||
|
||||
fn constrain_def(
|
||||
|
Loading…
Reference in New Issue
Block a user