diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-06-18 14:37:51 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-06-19 14:38:30 +0200 |
commit | b47796fe2177b30c3406e2735c2e7b9b4a892292 (patch) | |
tree | 442160799313b0c24a340daa809c1fe718da0039 /crawl-ref/source/l_option.cc | |
parent | 4835408b6ab43dc3c71c0b594bb414fab33921cf (diff) | |
download | crawl-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.cc | 3 |
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]; |