mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Attempt a mono/ approach for List.get
This commit is contained in:
parent
5992b42ebe
commit
f0b76f41da
2 changed files with 147 additions and 5 deletions
|
@ -420,10 +420,10 @@ fn union_sorted_tags_help<'a>(
|
|||
let mut result = Vec::with_capacity_in(tags_vec.len(), arena);
|
||||
|
||||
for (tag_name, arguments) in tags_vec {
|
||||
// resverse space for the tag discriminant
|
||||
// +1 to reserve space for the discriminant
|
||||
let mut arg_layouts = Vec::with_capacity_in(arguments.len() + 1, arena);
|
||||
|
||||
// add the tag discriminant
|
||||
// add the discriminant
|
||||
arg_layouts.push(Layout::Builtin(Builtin::Int64));
|
||||
|
||||
for var in arguments {
|
||||
|
@ -434,6 +434,7 @@ fn union_sorted_tags_help<'a>(
|
|||
|
||||
result.push((tag_name, arg_layouts.into_bump_slice()));
|
||||
}
|
||||
|
||||
UnionVariant::Wrapped(result)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue