From b2def962481476a5fae92f8539e5f061022bf442 Mon Sep 17 00:00:00 2001 From: tron Date: Fri, 19 Jan 2007 11:47:48 +0000 Subject: (svn r8276) -Fix Change the signature of Swap() to be less error prone, i.e. pass the variables to be swapped by reference instead of passing pointers to the variables. Just do Swap(x, y) instead of Swap(&x, &y). This prevents accidents when the variables are pointers. --- src/pathfind.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pathfind.cpp') diff --git a/src/pathfind.cpp b/src/pathfind.cpp index 955394603..056d96155 100644 --- a/src/pathfind.cpp +++ b/src/pathfind.cpp @@ -932,11 +932,11 @@ start_at: assert(tpf->nstack == 1 || tpf->nstack == 2 || tpf->nstack == 3); if (tpf->nstack != 1) { uint32 r = Random(); - if (r&1) SwapT(&tpf->stack[0].track, &tpf->stack[1].track); + if (r & 1) Swap(tpf->stack[0].track, tpf->stack[1].track); if (tpf->nstack != 2) { TrackdirByte t = tpf->stack[2].track; - if (r&2) SwapT(&tpf->stack[0].track, &t); - if (r&4) SwapT(&tpf->stack[1].track, &t); + if (r & 2) Swap(tpf->stack[0].track, t); + if (r & 4) Swap(tpf->stack[1].track, t); tpf->stack[2].first_track = tpf->stack[2].track = t; } tpf->stack[0].first_track = tpf->stack[0].track; -- cgit v1.2.3-54-g00ecf