shithub: orca

Download patch

ref: c764ca15ae83ad54b1539c49494d712e0625d1c1
parent: 7e7580c66c95ccd1a6d5ebf5968c05867189c769
author: cancel <cancel@cancel.fm>
date: Mon Dec 3 07:54:29 EST 2018

Cleanup

--- a/sim.c
+++ b/sim.c
@@ -105,15 +105,13 @@
     gbuf[y * width + x] = '*';
     return;
   }
-  Glyph* at_dest = gbuf + (Usz)y0 * width + (Usz)x0;
-  if (*at_dest == '.') {
-    *at_dest = actual_char;
-    mbuffer_poke_flags_or(mbuf, height, width, (Usz)y0, (Usz)x0,
-                          Mark_flag_sleep);
+  Glyph* restrict g_at_dest = gbuf + (Usz)y0 * width + (Usz)x0;
+  if (*g_at_dest == '.') {
+    *g_at_dest = actual_char;
     gbuf[y * width + x] = '.';
+    mbuf[(Usz)y0 * width + (Usz)x0] |= Mark_flag_sleep;
   } else {
     gbuf[y * width + x] = '*';
-    mbuffer_poke_flags_or(mbuf, height, width, y, x, Mark_flag_sleep);
   }
 }