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/mapdef.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/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 358c6fce23..6a8d4af9ce 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -111,7 +111,7 @@ void map_register_flag(const string &flag) static bool _map_tag_is_selectable(const string &tag) { - return Map_Flag_Names.find(tag) == Map_Flag_Names.end() + return !Map_Flag_Names.count(tag) && tag.find("luniq_") != 0 && tag.find("uniq_") != 0 && tag.find("ruin_") != 0 @@ -2272,7 +2272,7 @@ void map_def::reinit() bool map_def::map_already_used() const { - return you.uniq_map_names.find(name) != you.uniq_map_names.end() + return you.uniq_map_names.count(name) || env.level_uniq_maps.find(name) != env.level_uniq_maps.end() || env.new_used_subvault_names.find(name) != |