mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Correct small_array resize examples
This commit is contained in:
@@ -283,7 +283,7 @@ Output:
|
|||||||
|
|
||||||
[1, 2]
|
[1, 2]
|
||||||
[1]
|
[1]
|
||||||
[1, 2, 0, 0, 0]
|
[1, 0, 0, 0, 0]
|
||||||
*/
|
*/
|
||||||
resize :: proc "contextless" (a: ^$A/Small_Array($N, $T), length: int) {
|
resize :: proc "contextless" (a: ^$A/Small_Array($N, $T), length: int) {
|
||||||
prev_len := a.len
|
prev_len := a.len
|
||||||
@@ -316,10 +316,10 @@ Example:
|
|||||||
small_array.push_back(&a, 2)
|
small_array.push_back(&a, 2)
|
||||||
fmt.println(small_array.slice(&a))
|
fmt.println(small_array.slice(&a))
|
||||||
|
|
||||||
small_array.resize(&a, 1)
|
small_array.non_zero_resize(&a, 1)
|
||||||
fmt.println(small_array.slice(&a))
|
fmt.println(small_array.slice(&a))
|
||||||
|
|
||||||
small_array.resize(&a, 100)
|
small_array.non_zero_resize(&a, 100)
|
||||||
fmt.println(small_array.slice(&a))
|
fmt.println(small_array.slice(&a))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user