1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-01 09:36:40 +00:00

Small optimization.

This commit is contained in:
Marek Kochanowicz 2013-12-21 11:01:40 +01:00
parent 385824aee0
commit a6c36e2377

View file

@ -20,7 +20,6 @@ void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::str
{ {
//Checks for books, than, when stage is above mBooksSize goes to other checks, with (stage - PrevSum) as stage. //Checks for books, than, when stage is above mBooksSize goes to other checks, with (stage - PrevSum) as stage.
bool CheckPerformed = false; bool CheckPerformed = false;
int PrevSum(0);
if (stage <= mBooksSize) if (stage <= mBooksSize)
{ {
@ -32,12 +31,11 @@ void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::str
{ {
return; return;
} }
stage -= mBooksSize;
PrevSum += mBooksSize;
if ((stage) <= mActivatorsSize)
if ((stage - PrevSum) <= mActivatorsSize)
{ {
activatorCheck(stage - PrevSum, mReferencables.getActivators(), messages); activatorCheck(stage, mReferencables.getActivators(), messages);
CheckPerformed = true; CheckPerformed = true;
} }
@ -45,8 +43,7 @@ void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::str
{ {
return; return;
} }
stage -= mActivatorsSize;
PrevSum += mActivatorsSize;
} }
int CSMTools::ReferenceableCheckStage::setup() int CSMTools::ReferenceableCheckStage::setup()