Correct mem.clone_slice
This commit is contained in:
1 parent
bd86993035
commit
81623861c0
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -289,8 +289,8 @@ calc_padding_with_header :: proc(ptr: uintptr, align: uintptr, header_size: int)
|
||||
|
||||
|
||||
|
||||
clone_slice :: proc(slice: $T/[]$E, allocator := context.allocator, loc := #caller_location) -> T {
|
||||
new_slice := make(T, len(slice), allocator, loc);
|
||||
clone_slice :: proc(slice: $T/[]$E, allocator := context.allocator, loc := #caller_location) -> (new_slice: T) {
|
||||
new_slice, _ = make(T, len(slice), allocator, loc);
|
||||
runtime.copy(new_slice, slice);
|
||||
return new_slice;
|
||||
}
|
||||
Reference in new issue
Block a user