summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dbg-util.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2011-07-04 17:59:38 +0200
committerAdam Borowski <kilobyte@angband.pl>2011-07-05 02:21:51 +0200
commit06bb5b5c8199203001e4b3479351adf321299be5 (patch)
treec0bd4f83380fe5f3f408b3b605838e0d056b309b /crawl-ref/source/dbg-util.cc
parenteb03baac873c59367d8308b3c0a535b136f99633 (diff)
downloadcrawl-ref-06bb5b5c8199203001e4b3479351adf321299be5.tar.gz
crawl-ref-06bb5b5c8199203001e4b3479351adf321299be5.zip
cppcheck: fix inefficient checking for emptiness.
On some STL structures size() is slow. I did not bother limitting sed, so innocent bystanders got pulled into the machine, but there's no loss.
Diffstat (limited to 'crawl-ref/source/dbg-util.cc')
-rw-r--r--crawl-ref/source/dbg-util.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/dbg-util.cc b/crawl-ref/source/dbg-util.cc
index 5c5a18c45d..c1f7ff593c 100644
--- a/crawl-ref/source/dbg-util.cc
+++ b/crawl-ref/source/dbg-util.cc
@@ -211,7 +211,7 @@ void debug_dump_mon(const monster* mon, bool recurse)
fprintf(stderr, " travel_path.size() = %u\n",
(unsigned int)mon->travel_path.size());
- if (mon->travel_path.size() > 0)
+ if (!mon->travel_path.empty())
{
fprintf(stderr, " next travel step: %s\n",
debug_coord_str(mon->travel_path.back()).c_str());