Minor optimization to avoid read-after-write in Gv_DivVar()

git-svn-id: https://svn.eduke32.com/eduke32@7663 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-05-19 03:55:23 +00:00 committed by Christoph Oelckers
parent 9aa1030a09
commit bf6730d8a3
1 changed files with 3 additions and 3 deletions

View File

@ -240,10 +240,10 @@ static FORCE_INLINE void __fastcall Gv_DivVar(int const id, int32_t const operan
(var.flags & GAMEVAR_PERACTOR && (unsigned) vm.spriteNum > MAXSPRITES - 1)))
return;
static libdivide_s32_t sdiv;
static int32_t lastValue;
intptr_t *iptr = &var.global;
bool const foundInTable = (unsigned) operand < DIVTABLESIZE;
static libdivide_s32_t sdiv;
intptr_t *iptr = &var.global;
static int32_t lastValue;
auto dptr = foundInTable ? (libdivide_s32_t *) &divtable32[operand] : &sdiv;
if (operand == lastValue || foundInTable)