summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fineff.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2011-07-04 23:54:32 +0200
committerAdam Borowski <kilobyte@angband.pl>2011-07-05 02:23:41 +0200
commite4066ccd619b59a64c6fc9643a478fa7ef72f600 (patch)
tree949c30d9c926395a397e70f0a5ffcedb6edff9ac /crawl-ref/source/fineff.cc
parent06bb5b5c8199203001e4b3479351adf321299be5 (diff)
downloadcrawl-ref-e4066ccd619b59a64c6fc9643a478fa7ef72f600.tar.gz
crawl-ref-e4066ccd619b59a64c6fc9643a478fa7ef72f600.zip
cppcheck: use ++p not p++ for complex types (like iterators).
Pre-increment looks worse than post-increment, but on a C++ object the latter forces an allocation plus copy that is completely unnecessary but the compiler doesn't know that yet. Note that I did change some of our iterators to return void rather than the old or new value for exactly this performance reason before, breaking the expected behaviour. If that's an issue, tell me, we can use preincrements instead which have very little penalty.
Diffstat (limited to 'crawl-ref/source/fineff.cc')
-rw-r--r--crawl-ref/source/fineff.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/fineff.cc b/crawl-ref/source/fineff.cc
index 8a5f986cba..4a2676626e 100644
--- a/crawl-ref/source/fineff.cc
+++ b/crawl-ref/source/fineff.cc
@@ -35,7 +35,7 @@ void add_final_effect(final_effect_flavour flavour,
for (std::vector<final_effect>::iterator fi = env.final_effects.begin();
fi != env.final_effects.end();
- fi++)
+ ++fi)
{
if (fi->flavour == fe.flavour
&& fi->att == fe.att