summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_option.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-06-18 14:37:51 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-06-19 14:38:30 +0200
commitb47796fe2177b30c3406e2735c2e7b9b4a892292 (patch)
tree442160799313b0c24a340daa809c1fe718da0039 /crawl-ref/source/l_option.cc
parent4835408b6ab43dc3c71c0b594bb414fab33921cf (diff)
downloadcrawl-ref-b47796fe2177b30c3406e2735c2e7b9b4a892292.tar.gz
crawl-ref-b47796fe2177b30c3406e2735c2e7b9b4a892292.zip
Use ARRAYSZ() instead of sizeof division, for readability.
Also, it's not vulnerable to changes to the underlying types.
Diffstat (limited to 'crawl-ref/source/l_option.cc')
-rw-r--r--crawl-ref/source/l_option.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/crawl-ref/source/l_option.cc b/crawl-ref/source/l_option.cc
index aade8033db..aa4a8e049c 100644
--- a/crawl-ref/source/l_option.cc
+++ b/crawl-ref/source/l_option.cc
@@ -68,8 +68,7 @@ static const option_handler *get_handler(const char *optname)
{
if (optname)
{
- for (int i = 0, count = sizeof(handlers) / sizeof(*handlers);
- i < count; ++i)
+ for (int i = 0, count = ARRAYSZ(handlers); i < count; ++i)
{
if (!strcmp(handlers[i].option, optname))
return &handlers[i];