shithub: puzzles

Download patch

ref: e5b0bcae5615d8829c8b5af2e3127397e7b72d8c
parent: 493d2fb138ba64faf795e1b4c01fd4f0d49075fc
author: Ben Harris <bjh21@bjh21.me.uk>
date: Mon Dec 5 08:45:35 EST 2022

mosaic: Don't bother initialising fields in decode_ui()

The game_ui is guaranteed to have been freshly generated by new_ui(),
so there's no need to set fields to values that new_ui() has already
set.

--- a/mosaic.c
+++ b/mosaic.c
@@ -1026,11 +1026,6 @@
 
 static void decode_ui(game_ui *ui, const char *encoding)
 {
-    ui->last_x = -1;
-    ui->last_y = -1;
-    ui->last_state = 0;
-    ui->solved = false;
-    ui->cur_x = ui->cur_y = 0;
 }
 
 static void game_changed_state(game_ui *ui, const game_state *oldstate,