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/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/maps.cc')
-rw-r--r-- | crawl-ref/source/maps.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc index cc9035343d..ca3c33a17d 100644 --- a/crawl-ref/source/maps.cc +++ b/crawl-ref/source/maps.cc @@ -936,7 +936,7 @@ static bool _vault_chance_new(const map_def &map, // first such vault for the chance roll. Note that // at this point we ignore chance_priority. const string tag = vault_chance_tag(map); - if (chance_tags.find(tag) == chance_tags.end()) + if (!chance_tags.count(tag)) { if (!tag.empty()) chance_tags.insert(tag); @@ -1394,7 +1394,7 @@ static void _write_map_cache(const string &filename, size_t vs, size_t ve, static void _parse_maps(const string &s) { string cache_name = get_cache_name(s); - if (map_files_read.find(cache_name) != map_files_read.end()) + if (map_files_read.count(cache_name)) return; map_files_read.insert(cache_name); |