From 43b06bab1548beaefb7b0b0c0ba58f6d830e46e4 Mon Sep 17 00:00:00 2001 From: Nino van Hooff Date: Fri, 25 Oct 2024 11:32:29 +0200 Subject: [PATCH] CHANGE seqBuilder to iterator and other small refactors --- src/playdate/bindings/utils.nim | 7 +++++++ src/playdate/scoreboards.nim | 29 ++++++----------------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/playdate/bindings/utils.nim b/src/playdate/bindings/utils.nim index f2cb4ce..a4cb91a 100644 --- a/src/playdate/bindings/utils.nim +++ b/src/playdate/bindings/utils.nim @@ -1,5 +1,12 @@ import macros +iterator items*[T](rawField: ptr UncheckedArray[T], len: Natural): T = + ## iterate through a C array + ## To convert to a Nim seq: + ## `cArray.items(count).toSeq` + for i in 0..