diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-11-13 16:39:05 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-11-15 21:03:43 +0100 |
commit | cede7d61d912750e3bd04ef9d54f3ffd63fb308f (patch) | |
tree | 49c3bf8553811a790fbf991aee59448c99d9baad /crawl-ref/source/dbg-maps.cc | |
parent | 1eb5ba87ee17c68aa806a7df4ce309b84829a593 (diff) | |
download | crawl-ref-cede7d61d912750e3bd04ef9d54f3ffd63fb308f.tar.gz crawl-ref-cede7d61d912750e3bd04ef9d54f3ffd63fb308f.zip |
Don't allocate pointless iterators.
map or set.count() can test the presence of a given key and return 0 or 1
outright.
Diffstat (limited to 'crawl-ref/source/dbg-maps.cc')
-rw-r--r-- | crawl-ref/source/dbg-maps.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/dbg-maps.cc b/crawl-ref/source/dbg-maps.cc index 951c8a470d..214195d9ba 100644 --- a/crawl-ref/source/dbg-maps.cc +++ b/crawl-ref/source/dbg-maps.cc @@ -259,7 +259,7 @@ static void _mapgen_report_available_random_vaults(FILE *outf) static void _check_mapless(const level_id &lid, vector<level_id> &mapless) { - if (mapgen_level_mapsused.find(lid) == mapgen_level_mapsused.end()) + if (!mapgen_level_mapsused.count(lid)) mapless.push_back(lid); } @@ -314,7 +314,7 @@ static void _write_mapgen_stats() for (int i = 0, size = map_count(); i < size; ++i) { const map_def *map = map_by_index(i); - if (mapgen_try_count.find(map->name) == mapgen_try_count.end() + if (!mapgen_try_count.count(map->name) && !map->has_tag("dummy")) { unused_maps.push_back(map->name); |