aboutsummaryrefslogtreecommitdiff
path: root/src/main.S
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-02-18 19:16:21 +0100
committerFelix Morgner <felix.morgner@gmail.com>2026-02-18 19:16:21 +0100
commit31fe77e83a23cf7fa72b7adfd7d7c8d226cefe0c (patch)
tree232d1a2f0b9f071eeb08ec51fe787ac465cd4af0 /src/main.S
parent5ad41b0af4485f878228dfdebb9ad068898b5a2c (diff)
downloadsnake.s-31fe77e83a23cf7fa72b7adfd7d7c8d226cefe0c.tar.xz
snake.s-31fe77e83a23cf7fa72b7adfd7d7c8d226cefe0c.zip
refactor: simplify loop exit
Diffstat (limited to 'src/main.S')
-rw-r--r--src/main.S9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main.S b/src/main.S
index 6bad719..270aa49 100644
--- a/src/main.S
+++ b/src/main.S
@@ -117,9 +117,8 @@
mov (%r13), %r8d
// user requested to quit
- mov $SDL_EVENT_QUIT, %r9d
- cmp %r8d, %r9d
- sete %r12b
+ cmp $SDL_EVENT_QUIT, %r8d
+ je .Lloop_end
// use white color
load_local renderer_handle, %rdi
@@ -152,8 +151,8 @@
mov %r13, %rdi
call SDL_RenderPresent@PLT
- test %r12b, %r12b
- jz .Lloop
+ jmp .Lloop
+ .Lloop_end:
.Ldestroy_renderer:
// destroy the renderer