mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Merge pull request #765 from rtfeldman/list-refcount-issues
Fix some list refcount issues
This commit is contained in:
commit
567e0e6a8f
5 changed files with 126 additions and 126 deletions
|
@ -669,9 +669,9 @@ pub fn strConcat(ptr_size: u32, result_in_place: InPlace, arg1: RocStr, arg2: Ro
|
|||
|
||||
fn strConcatHelp(comptime T: type, result_in_place: InPlace, arg1: RocStr, arg2: RocStr) RocStr {
|
||||
if (arg1.is_empty()) {
|
||||
return cloneNonemptyStr(T, result_in_place, arg2);
|
||||
return cloneStr(T, result_in_place, arg2);
|
||||
} else if (arg2.is_empty()) {
|
||||
return cloneNonemptyStr(T, result_in_place, arg1);
|
||||
return cloneStr(T, result_in_place, arg1);
|
||||
} else {
|
||||
const combined_length = arg1.len() + arg2.len();
|
||||
|
||||
|
@ -738,7 +738,7 @@ const InPlace = packed enum(u8) {
|
|||
Clone,
|
||||
};
|
||||
|
||||
fn cloneNonemptyStr(comptime T: type, in_place: InPlace, str: RocStr) RocStr {
|
||||
fn cloneStr(comptime T: type, in_place: InPlace, str: RocStr) RocStr {
|
||||
if (str.is_small_str() or str.is_empty()) {
|
||||
// just return the bytes
|
||||
return str;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue