From e796653d0ccd214192261ed1715dc68806758926 Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Wed, 6 Sep 2017 01:46:43 +0300 Subject: [PATCH] don't be *too* smart: `swapInt()` should not do xor trick, 'cause we may pass the same var to it --- src/game/g_grid.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/g_grid.pas b/src/game/g_grid.pas index b7b9e3f..280fd90 100644 --- a/src/game/g_grid.pas +++ b/src/game/g_grid.pas @@ -323,8 +323,8 @@ uses // ////////////////////////////////////////////////////////////////////////// // -//procedure swapInt (var a: Integer; var b: Integer); inline; var t: Integer; begin t := a; a := b; b := t; end; -procedure swapInt (var a: Integer; var b: Integer); inline; begin a := a xor b; b := b xor a; a := a xor b; end; +procedure swapInt (var a: Integer; var b: Integer); inline; var t: Integer; begin t := a; a := b; b := t; end; +//procedure swapInt (var a: Integer; var b: Integer); inline; begin a := a xor b; b := b xor a; a := a xor b; end; //function minInt (a, b: Integer): Integer; inline; begin if (a < b) then result := a else result := b; end; //function maxInt (a, b: Integer): Integer; inline; begin if (a > b) then result := a else result := b; end; -- 2.29.2