aboutsummaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-10-17 18:32:24 +0000
committerSimon Tatham <anakin@pobox.com>2005-10-17 18:32:24 +0000
commitf9168d6003042b3dfa175175f54b512c5886ac18 (patch)
tree58e5359134b689a0455570fa1c92e8771c1f9c04 /net.c
parent5f16a29d4c5e90011aec7d9d00f02edf713a3304 (diff)
downloadpuzzles-f9168d6003042b3dfa175175f54b512c5886ac18.zip
puzzles-f9168d6003042b3dfa175175f54b512c5886ac18.tar.gz
puzzles-f9168d6003042b3dfa175175f54b512c5886ac18.tar.bz2
puzzles-f9168d6003042b3dfa175175f54b512c5886ac18.tar.xz
Just noticed a longhand shuffling operation which I must have missed
when I converted them all into calls to shuffle(). [originally from svn r6404]
Diffstat (limited to 'net.c')
-rw-r--r--net.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/net.c b/net.c
index 29a3a27..f8811a7 100644
--- a/net.c
+++ b/net.c
@@ -897,14 +897,7 @@ static void perturb(int w, int h, unsigned char *tiles, int wrapping,
perim2 = snewn(nperim, struct xyd);
memcpy(perim2, perimeter, nperim * sizeof(struct xyd));
/* Shuffle the perimeter, so as to search it without directional bias. */
- for (i = nperim; --i ;) {
- int j = random_upto(rs, i+1);
- struct xyd t;
-
- t = perim2[j];
- perim2[j] = perim2[i];
- perim2[i] = t;
- }
+ shuffle(perim2, nperim, sizeof(*perim2), rs);
for (i = 0; i < nperim; i++) {
int x2, y2;