shithub: orca

Download patch

ref: d091bc4270c48d9d346645a1c4aea3f78dbe6352
parent: 62810ec4341d5b80a1a34a798dd17f22537c9778
author: cancel <cancel@cancel.fm>
date: Wed Dec 19 00:11:50 EST 2018

Cleanup

--- a/sim.c
+++ b/sim.c
@@ -73,12 +73,6 @@
   return indexed_glyphs[(ia + ib) % Glyphs_index_max];
 }
 
-static Glyph glyphs_mod(Glyph a, Glyph b) {
-  Usz ia = index_of(a);
-  Usz ib = index_of(b);
-  return indexed_glyphs[ib == 0 ? 0 : (ia % ib)];
-}
-
 ORCA_PURE static bool oper_has_neighboring_bang(Glyph const* gbuf, Usz h, Usz w,
                                                 Usz y, Usz x) {
   Glyph const* gp = gbuf + w * y + x;
@@ -706,7 +700,9 @@
 BEGIN_DUAL_PHASE_1(modulo)
   REALIZE_DUAL;
   STOP_IF_DUAL_INACTIVE;
-  POKE(1, 0, glyphs_mod(PEEK(0, 1), PEEK(0, 2)));
+  Usz ia = index_of(PEEK(0, 1));
+  Usz ib = index_of(PEEK(0, 2));
+  POKE(1, 0, indexed_glyphs[ib == 0 ? 0 : (ia % ib)]);
 END_PHASE
 
 BEGIN_DUAL_PHASE_0(offset)