diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-07-04 17:59:38 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-07-05 02:21:51 +0200 |
commit | 06bb5b5c8199203001e4b3479351adf321299be5 (patch) | |
tree | c0bd4f83380fe5f3f408b3b605838e0d056b309b /crawl-ref/source/shopping.h | |
parent | eb03baac873c59367d8308b3c0a535b136f99633 (diff) | |
download | crawl-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/shopping.h')
-rw-r--r-- | crawl-ref/source/shopping.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/shopping.h b/crawl-ref/source/shopping.h index 463e1cf5f4..91a742f38d 100644 --- a/crawl-ref/source/shopping.h +++ b/crawl-ref/source/shopping.h @@ -62,6 +62,7 @@ public: void refresh(); + bool empty() const { return !list || list->empty(); }; int size() const; static bool items_are_same(const item_def& item_a, |