aboutsummaryrefslogtreecommitdiff
path: root/tracks.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2023-04-20 13:56:44 +0100
committerSimon Tatham <anakin@pobox.com>2023-04-20 17:22:23 +0100
commitf21c7d27664bc43d3e5a9401756860c03055c3aa (patch)
tree132993b10b21f8be6e559174c50a3ac12b5901fe /tracks.c
parent11a8149d673d96bec17d6487b5fa95b5bf5ffd6b (diff)
downloadpuzzles-f21c7d27664bc43d3e5a9401756860c03055c3aa.zip
puzzles-f21c7d27664bc43d3e5a9401756860c03055c3aa.tar.gz
puzzles-f21c7d27664bc43d3e5a9401756860c03055c3aa.tar.bz2
puzzles-f21c7d27664bc43d3e5a9401756860c03055c3aa.tar.xz
Consistently use snew_dsf to allocate dsfs.
All remaining cases where a dsf was allocated via snewn(foo, int) are removed by this change.
Diffstat (limited to 'tracks.c')
-rw-r--r--tracks.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tracks.c b/tracks.c
index 728e5a6..b1145d8 100644
--- a/tracks.c
+++ b/tracks.c
@@ -1373,8 +1373,7 @@ static int solve_check_loop(game_state *state)
/* TODO eventually we should pull this out into a solver struct and keep it
updated as we connect squares. For now we recreate it every time we try
this particular solver step. */
- dsf = snewn(w*h, int);
- dsf_init(dsf, w*h);
+ dsf = snew_dsf(w*h);
/* Work out the connectedness of the current loop set. */
for (x = 0; x < w; x++) {
@@ -1878,8 +1877,7 @@ static bool check_completion(game_state *state, bool mark)
}
}
- dsf = snewn(w*h, int);
- dsf_init(dsf, w*h);
+ dsf = snew_dsf(w*h);
for (x = 0; x < w; x++) {
for (y = 0; y < h; y++) {