diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-07-08 15:29:46 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-02 14:24:49 +0000 |
| commit | 18c3a886e4d45f2da4af0da4b9d85a61695a17ad (patch) | |
| tree | cbeace97b448ab32e83058232853dd7afaf124f7 | |
| parent | store RTNode in Builtin (diff) | |
| download | alive-18c3a886e4d45f2da4af0da4b9d85a61695a17ad.tar.gz alive-18c3a886e4d45f2da4af0da4b9d85a61695a17ad.zip | |
(unecessarily) store util/switch index in state
| -rw-r--r-- | alv-lib/util.moon | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/alv-lib/util.moon b/alv-lib/util.moon index a2142fa..c8f354e 100644 --- a/alv-lib/util.moon +++ b/alv-lib/util.moon @@ -35,16 +35,13 @@ switch_ = Constant.meta tick: => { :i, :values } = @inputs - active = switch i! - when true - values[1] - when false - values[2] - else - i = 1 + (math.floor i!) % #values - values[i] + ii = switch i! + when true then 1 + when false then 2 + else 1 + (math.floor i!) % #values - @out\set active and active! + @state = ii - 1 + @out\set values[ii] and values[ii]! edge = Constant.meta meta: |
