diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-10-17 02:27:28 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-10-17 22:25:38 +0200 |
commit | df690be638a174e82a272ef206cb303975403b73 (patch) | |
tree | 590d6cb51461608cbbe6eeac94ec6a4a9464107b /crawl-ref/source/mapdef.cc | |
parent | 4f4fca30c5a92f50e3142b36a93dbc5f40002565 (diff) | |
download | crawl-ref-df690be638a174e82a272ef206cb303975403b73.tar.gz crawl-ref-df690be638a174e82a272ef206cb303975403b73.zip |
Use vector.empty() for emptiness tests.
Unlike some other containers, it's unlikely it's faster than checking size()
anywhere, but let's be consistent.
Diffstat (limited to 'crawl-ref/source/mapdef.cc')
-rw-r--r-- | crawl-ref/source/mapdef.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index ce16dcb187..06d53d82af 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -4465,13 +4465,13 @@ void item_list::clear() item_spec item_list::random_item() { - if (items.size() <= 0) + if (items.empty()) { const item_spec none; return none; } - return (get_item(random2(size()))); + return get_item(random2(size())); } typedef pair<item_spec, int> item_pair; |