Attempt a mono/ approach for List.get

This commit is contained in:
Richard Feldman 2020-04-25 06:19:06 -04:00
parent 5992b42ebe
commit f0b76f41da
2 changed files with 147 additions and 5 deletions

View file

@ -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)
}
}