From 1bd42ee98eff237cbc8e3856aa1e63ef5bc5b64a Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 28 Jan 2018 09:10:00 +1100 Subject: Use std::end when filling arrays as reduces chance of mistake. --- lexlib/WordList.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lexlib/WordList.cxx') diff --git a/lexlib/WordList.cxx b/lexlib/WordList.cxx index f65b5ed48..425bcc01a 100644 --- a/lexlib/WordList.cxx +++ b/lexlib/WordList.cxx @@ -10,6 +10,7 @@ #include #include +#include #include "StringCopy.h" #include "WordList.h" @@ -128,7 +129,7 @@ void WordList::Set(const char *s) { #else SortWordList(words, len); #endif - std::fill(starts, starts + ELEMENTS(starts), -1); + std::fill(starts, std::end(starts), -1); for (int l = len - 1; l >= 0; l--) { unsigned char indexChar = words[l][0]; starts[indexChar] = l; -- cgit v1.2.3