From a6c36e23779251ad652312fe06742fa122880380 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Sat, 21 Dec 2013 11:01:40 +0100 Subject: [PATCH] Small optimization. --- apps/opencs/model/tools/referenceablecheck.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/apps/opencs/model/tools/referenceablecheck.cpp b/apps/opencs/model/tools/referenceablecheck.cpp index eceaf999ba..8eff6ed0bc 100644 --- a/apps/opencs/model/tools/referenceablecheck.cpp +++ b/apps/opencs/model/tools/referenceablecheck.cpp @@ -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. bool CheckPerformed = false; - int PrevSum(0); if (stage <= mBooksSize) { @@ -32,12 +31,11 @@ void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::str { return; } - - PrevSum += mBooksSize; - - if ((stage - PrevSum) <= mActivatorsSize) + stage -= mBooksSize; + + if ((stage) <= mActivatorsSize) { - activatorCheck(stage - PrevSum, mReferencables.getActivators(), messages); + activatorCheck(stage, mReferencables.getActivators(), messages); CheckPerformed = true; } @@ -45,8 +43,7 @@ void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::str { return; } - - PrevSum += mActivatorsSize; + stage -= mActivatorsSize; } int CSMTools::ReferenceableCheckStage::setup()