Merge pull request #765 from rtfeldman/list-refcount-issues

Fix some list refcount issues
This commit is contained in:
Richard Feldman 2020-12-03 22:23:21 -05:00 committed by GitHub
commit 567e0e6a8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 126 additions and 126 deletions

View file

@ -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;