mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
fix too many arguments
This commit is contained in:
parent
c26d20e4e5
commit
e912edcfdd
1 changed files with 4 additions and 3 deletions
|
@ -910,13 +910,14 @@ test "endsWith: hello world ends with world" {
|
|||
}
|
||||
|
||||
// Str.concat
|
||||
pub fn strConcatC(result_in_place: InPlace, arg1: RocStr, arg2: RocStr) callconv(.C) RocStr {
|
||||
return @call(.{ .modifier = always_inline }, strConcat, .{ result_in_place, arg1, arg2 });
|
||||
pub fn strConcatC(arg1: RocStr, arg2: RocStr) callconv(.C) RocStr {
|
||||
return @call(.{ .modifier = always_inline }, strConcat, .{ arg1, arg2 });
|
||||
}
|
||||
|
||||
fn strConcat(result_in_place: InPlace, arg1: RocStr, arg2: RocStr) RocStr {
|
||||
fn strConcat(arg1: RocStr, arg2: RocStr) RocStr {
|
||||
if (arg1.isEmpty()) {
|
||||
// the second argument is borrowed, so we must increment its refcount before returning
|
||||
const result_in_place = InPlace.Clone;
|
||||
return RocStr.clone(result_in_place, arg2);
|
||||
} else if (arg2.isEmpty()) {
|
||||
// the first argument is owned, so we can return it without cloning
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue