mutable decl syntax change
This commit is contained in:
@@ -28,7 +28,7 @@ reserve func($T type, list @mut ArrayList(T), min_capacity usize) void ! mem.All
|
||||
return
|
||||
}
|
||||
|
||||
new_capacity usize = 8
|
||||
new_capacity usize := 8
|
||||
if list.capacity >= 8 {
|
||||
half usize :: divtrunc!(list.capacity, 2)
|
||||
if list.capacity > maxval!(usize) - half {
|
||||
|
||||
@@ -2,7 +2,7 @@ import "@std/mem"
|
||||
import "@std/testing"
|
||||
|
||||
handles_append test {
|
||||
list ArrayList(i32) = init(mem.c_allocator)
|
||||
list ArrayList(i32) := init(mem.c_allocator)
|
||||
defer deinit(&list)
|
||||
|
||||
try append(&list, 42)
|
||||
@@ -12,7 +12,7 @@ handles_append test {
|
||||
}
|
||||
|
||||
handles_clear test {
|
||||
list ArrayList(i32) = init(mem.c_allocator)
|
||||
list ArrayList(i32) := init(mem.c_allocator)
|
||||
defer deinit(&list)
|
||||
|
||||
try append(&list, 42)
|
||||
@@ -22,7 +22,7 @@ handles_clear test {
|
||||
}
|
||||
|
||||
handles_reserve test {
|
||||
list ArrayList(i32) = init(mem.c_allocator)
|
||||
list ArrayList(i32) := init(mem.c_allocator)
|
||||
defer deinit(&list)
|
||||
|
||||
try reserve(&list, 10)
|
||||
|
||||
Reference in New Issue
Block a user