mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Shrink smallvecs
This commit is contained in:
parent
20ce0548cc
commit
34b9df8281
2 changed files with 4 additions and 4 deletions
|
@ -172,7 +172,7 @@ fn eval_apply(expr: Evaluated, args: Vec<Expr>, vars: &Scope) -> Evaluated {
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn eval_closure(args: Vec<Evaluated>, arg_patterns: SmallVec<[Pattern; 4]>, vars: &Scope)
|
||||
fn eval_closure(args: Vec<Evaluated>, arg_patterns: SmallVec<[Pattern; 2]>, vars: &Scope)
|
||||
-> Result<Scope, expr::Problem>
|
||||
{
|
||||
if arg_patterns.len() == args.len() {
|
||||
|
@ -292,7 +292,7 @@ fn eval_operator(Evaluated(left_expr): &Evaluated, op: Operator, Evaluated(right
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn eval_case (condition: Evaluated, branches: SmallVec<[(Pattern, Box<Expr>); 4]>, vars: &Scope) -> Evaluated {
|
||||
fn eval_case (condition: Evaluated, branches: SmallVec<[(Pattern, Box<Expr>); 2]>, vars: &Scope) -> Evaluated {
|
||||
let Evaluated(ref evaluated_expr) = condition;
|
||||
|
||||
for (pattern, definition) in branches {
|
||||
|
|
|
@ -19,7 +19,7 @@ pub enum Expr {
|
|||
Func(Ident, Vec<Expr>),
|
||||
Apply(Box<Expr>, Vec<Expr>),
|
||||
Operator(Box<Expr>, Operator, Box<Expr>),
|
||||
Closure(SmallVec<[Pattern; 4]>, Box<Expr>),
|
||||
Closure(SmallVec<[Pattern; 2]>, Box<Expr>),
|
||||
|
||||
// Sum Types
|
||||
ApplyVariant(String, Option<Vec<Expr>>),
|
||||
|
@ -29,7 +29,7 @@ pub enum Expr {
|
|||
|
||||
// Conditionals
|
||||
If(Box<Expr>, Box<Expr>, Box<Expr>),
|
||||
Case(Box<Expr>, SmallVec<[(Pattern, Box<Expr>); 4]>),
|
||||
Case(Box<Expr>, SmallVec<[(Pattern, Box<Expr>); 2]>),
|
||||
|
||||
// Error
|
||||
Error(Problem),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue