summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/exclude.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-11-13 16:39:05 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-11-15 21:03:43 +0100
commitcede7d61d912750e3bd04ef9d54f3ffd63fb308f (patch)
tree49c3bf8553811a790fbf991aee59448c99d9baad /crawl-ref/source/exclude.cc
parent1eb5ba87ee17c68aa806a7df4ce309b84829a593 (diff)
downloadcrawl-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/exclude.cc')
-rw-r--r--crawl-ref/source/exclude.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/exclude.cc b/crawl-ref/source/exclude.cc
index cc84b4b6b2..63bc57a25b 100644
--- a/crawl-ref/source/exclude.cc
+++ b/crawl-ref/source/exclude.cc
@@ -282,12 +282,12 @@ void exclude_set::recompute_excluded_points(bool recompute_los)
bool exclude_set::is_excluded(const coord_def &p) const
{
- return (exclude_points.find(p) != exclude_points.end());
+ return (exclude_points.count(p));
}
bool exclude_set::is_exclude_root(const coord_def &p) const
{
- return (exclude_roots.find(p) != exclude_roots.end());
+ return (exclude_roots.count(p));
}
travel_exclude* exclude_set::get_exclude_root(const coord_def &p)