mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Remove a couple vec allocs
This commit is contained in:
parent
5cc6727e9f
commit
a47dc711f3
2 changed files with 14 additions and 20 deletions
|
@ -1482,8 +1482,8 @@ fn constrain_typed_def(
|
|||
|
||||
constrain_def_make_constraint(
|
||||
constraints,
|
||||
new_rigid_variables,
|
||||
new_infer_variables,
|
||||
new_rigid_variables.into_iter(),
|
||||
new_infer_variables.into_iter(),
|
||||
expr_con,
|
||||
body_con,
|
||||
def_pattern_state,
|
||||
|
@ -1517,8 +1517,8 @@ fn constrain_typed_def(
|
|||
|
||||
constrain_def_make_constraint(
|
||||
constraints,
|
||||
new_rigid_variables,
|
||||
new_infer_variables,
|
||||
new_rigid_variables.into_iter(),
|
||||
new_infer_variables.into_iter(),
|
||||
expr_con,
|
||||
body_con,
|
||||
def_pattern_state,
|
||||
|
@ -1683,8 +1683,8 @@ fn constrain_def(
|
|||
|
||||
constrain_def_make_constraint(
|
||||
constraints,
|
||||
vec![],
|
||||
vec![],
|
||||
std::iter::empty(),
|
||||
std::iter::empty(),
|
||||
expr_con,
|
||||
body_con,
|
||||
def_pattern_state,
|
||||
|
@ -1695,8 +1695,8 @@ fn constrain_def(
|
|||
|
||||
pub fn constrain_def_make_constraint(
|
||||
constraints: &mut Constraints,
|
||||
new_rigid_variables: Vec<Variable>,
|
||||
new_infer_variables: Vec<Variable>,
|
||||
new_rigid_variables: impl Iterator<Item = Variable>,
|
||||
new_infer_variables: impl Iterator<Item = Variable>,
|
||||
expr_con: Constraint,
|
||||
body_con: Constraint,
|
||||
def_pattern_state: PatternState,
|
||||
|
|
|
@ -139,8 +139,8 @@ fn constrain_symbols_from_requires(
|
|||
constraints,
|
||||
// No new rigids or flex vars because they are represented in the type
|
||||
// annotation.
|
||||
vec![],
|
||||
vec![],
|
||||
std::iter::empty(),
|
||||
std::iter::empty(),
|
||||
Constraint::True,
|
||||
constraint,
|
||||
def_pattern_state,
|
||||
|
@ -187,14 +187,8 @@ pub fn frontload_ability_constraints(
|
|||
def_pattern_state.vars.push(member_data.signature_var);
|
||||
|
||||
let vars = &member_data.variables;
|
||||
let new_rigid_variables = vars
|
||||
.rigid_vars
|
||||
.iter()
|
||||
.chain(vars.able_vars.iter())
|
||||
.copied()
|
||||
.collect();
|
||||
|
||||
let new_infer_variables = vars.flex_vars.clone();
|
||||
let rigid_variables = vars.rigid_vars.iter().chain(vars.able_vars.iter()).copied();
|
||||
let infer_variables = vars.flex_vars.iter().copied();
|
||||
|
||||
def_pattern_state
|
||||
.constraints
|
||||
|
@ -207,8 +201,8 @@ pub fn frontload_ability_constraints(
|
|||
|
||||
constraint = constrain_def_make_constraint(
|
||||
constraints,
|
||||
new_rigid_variables,
|
||||
new_infer_variables,
|
||||
rigid_variables,
|
||||
infer_variables,
|
||||
Constraint::True,
|
||||
constraint,
|
||||
def_pattern_state,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue