From 170df94fe8ee787ebe9b5c428ad3378ec4089026 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Mon, 29 Nov 2021 14:15:41 -0600 Subject: [PATCH] using shorter for syntax in a test case --- tests/baked_parameters.onyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/baked_parameters.onyx b/tests/baked_parameters.onyx index 237afbc3..77bd3a63 100644 --- a/tests/baked_parameters.onyx +++ b/tests/baked_parameters.onyx @@ -9,7 +9,7 @@ count_to :: ($N: i32) { alloc_slice :: ($T: type_expr, N: i32) -> [] T { data := cast(^T) calloc(sizeof T * N); - return <[] T>.{ data, N }; + return .{ data, N }; } count_to_30 :: #solidify count_to { N = #value 30 }; @@ -25,9 +25,9 @@ main :: (args: [] cstr) { count_to(UP_TO); sl := alloc_slice(i32, 10); - for ^elem: sl do *elem = 1234; + for ^ sl do *it = 1234; - for elem: sl do println(elem); + for sl do println(it); // This is so much cleaner than the alternative. -- 2.25.1