mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Use alloc over dupe
This commit is contained in:
parent
c5172436c6
commit
fc2a37b22b
1 changed files with 1 additions and 1 deletions
|
@ -65,7 +65,7 @@ const RocStr = extern struct {
|
|||
if (length < roc_str_size) {
|
||||
return RocStr.empty();
|
||||
} else {
|
||||
var new_bytes: []u8 = mem.dupe(allocator, u8, bytes_ptr[0..length]) catch unreachable;
|
||||
var new_bytes: []T = allocator.alloc(u8, length) catch unreachable;
|
||||
|
||||
var new_bytes_ptr: [*]u8 = @ptrCast([*]u8, &new_bytes);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue