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/random.h | |
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/random.h')
-rw-r--r-- | crawl-ref/source/random.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/random.h b/crawl-ref/source/random.h index 93bc60c3f0..f5d04ab49d 100644 --- a/crawl-ref/source/random.h +++ b/crawl-ref/source/random.h @@ -121,7 +121,7 @@ template <typename T> void shuffle_array(vector<T> &vec) { // &vec[0] is undefined behaviour, and vec.data() is C++11-only. - if (vec.size() > 0) + if (!vec.empty()) shuffle_array(&vec[0], vec.size()); } |