summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_mons.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_mons.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_mons.cc')
-rw-r--r--crawl-ref/source/l_mons.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/l_mons.cc b/crawl-ref/source/l_mons.cc
index 3e9a1dfa4a..cbb089eec8 100644
--- a/crawl-ref/source/l_mons.cc
+++ b/crawl-ref/source/l_mons.cc
@@ -531,7 +531,7 @@ static int monster_get(lua_State *ls)
if (!attr)
return (0);
- for (unsigned i = 0; i < sizeof(mons_attrs) / sizeof(mons_attrs[0]); ++i)
+ for (unsigned i = 0; i < ARRAYSZ(mons_attrs); ++i)
if (!strcmp(attr, mons_attrs[i].attribute))
return (mons_attrs[i].accessor(ls, mons, attr));