Browse Source

Remove extra argument to each-in-strdict

windows-imgui
Macoy Madson 7 months ago
parent
commit
287fa6c26c
  1. 8
      src/Dictionary.cake

8
src/Dictionary.cake

@ -53,13 +53,13 @@
(def-c-function-alias strdict-value-at shget)
;; (dict (* <your Key Value type>) &return <your value type>)
(defmacro each-in-strdict (strdict any iterator-name symbol &rest body any)
(defmacro each-in-strdict (strdict any index-iterator-name &rest body any)
(tokenize-push output
(c-for
(var (token-splice iterator-name) size_t 0)
(var (token-splice index-iterator-name) size_t 0)
;; We could hoist this out but it should be a quick op anyways
(< (token-splice iterator-name) (strdict-length (token-splice strdict)))
(incr (token-splice iterator-name))
(< (token-splice index-iterator-name) (strdict-length (token-splice strdict)))
(incr (token-splice index-iterator-name))
(token-splice-rest body tokens)))
(return true))

Loading…
Cancel
Save