mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Change parameters to List.concat. Now it is less dependent on &args
This commit is contained in:
parent
a99adb9cdb
commit
2f2763351d
2 changed files with 12 additions and 9 deletions
|
@ -1631,7 +1631,15 @@ fn run_low_level<'a, 'ctx, 'env>(
|
|||
|
||||
list_reverse(env, parent, scope, list)
|
||||
}
|
||||
ListConcat => list_concat(env, scope, parent, args),
|
||||
ListConcat => {
|
||||
debug_assert_eq!(args.len(), 2);
|
||||
|
||||
let (first_list, list_layout) = load_symbol_and_layout(env, scope, &args[0]);
|
||||
|
||||
let second_list = load_symbol(env, scope, &args[1]);
|
||||
|
||||
list_concat(env, parent, first_list, second_list, list_layout)
|
||||
}
|
||||
ListAppend => {
|
||||
// List.append : List elem, elem -> List elem
|
||||
debug_assert_eq!(args.len(), 2);
|
||||
|
|
|
@ -863,19 +863,14 @@ pub fn list_len<'ctx>(
|
|||
/// List.concat : List elem, List elem -> List elem
|
||||
pub fn list_concat<'a, 'ctx, 'env>(
|
||||
env: &Env<'a, 'ctx, 'env>,
|
||||
scope: &Scope<'a, 'ctx>,
|
||||
parent: FunctionValue<'ctx>,
|
||||
args: &[Symbol],
|
||||
first_list: BasicValueEnum<'ctx>,
|
||||
second_list: BasicValueEnum<'ctx>,
|
||||
list_layout: &Layout<'a>,
|
||||
) -> BasicValueEnum<'ctx> {
|
||||
debug_assert_eq!(args.len(), 2);
|
||||
|
||||
let builder = env.builder;
|
||||
let ctx = env.context;
|
||||
|
||||
let (first_list, list_layout) = load_symbol_and_layout(env, scope, &args[0]);
|
||||
|
||||
let second_list = load_symbol(env, scope, &args[1]);
|
||||
|
||||
let second_list_wrapper = second_list.into_struct_value();
|
||||
|
||||
let second_list_len = list_len(builder, second_list_wrapper);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue