Prefer prefix ++/-- on non-primitive types

Postfix ++/-- might cause the creation of a tmp instance
that might be optimized out. Mights are bad. Prefix doesn't
have this problem.
This commit is contained in:
Michael Cook (mackal)
2014-01-13 22:14:02 -05:00
parent 47c33f3b31
commit 4216627604
51 changed files with 405 additions and 426 deletions
+3 -3
View File
@@ -1082,7 +1082,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
}
if(RuleB(TaskSystem, EnableTaskSystem))
UpdateTasksForItem(ActivityTradeSkill, itr->first, itr->second);
itr++;
++itr;
}
return(true);
} else {
@@ -1103,7 +1103,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
while(itr != spec->onfail.end()) {
//should we check these arguments?
SummonItem(itr->first, itr->second);
itr++;
++itr;
}
// Rolls on each item, is possible to return everything
@@ -1116,7 +1116,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
for(sc = 0; sc < itr->second; sc++)
if(MakeRandomInt(0,99) < SalvageChance)
SummonItem(itr->first, 1);
itr++;
++itr;
}
}