diff --git a/include/stringzilla/stringzilla.hpp b/include/stringzilla/stringzilla.hpp index a80da804..43869f08 100644 --- a/include/stringzilla/stringzilla.hpp +++ b/include/stringzilla/stringzilla.hpp @@ -283,7 +283,7 @@ class basic_charset { template explicit basic_charset(char_type const (&chars)[count_characters]) noexcept : basic_charset() { static_assert(count_characters > 0, "Character array cannot be empty"); - for (std::size_t i = 0; i < count_characters - 1; ++i) { // count_characters - 1 to exclude the null terminator + for (std::size_t i = 0; i != count_characters; ++i) { char_type c = chars[i]; bitset_._u64s[sz_bitcast(sz_u8_t, c) >> 6] |= (1ull << (sz_bitcast(sz_u8_t, c) & 63u)); } @@ -292,7 +292,7 @@ class basic_charset { template explicit basic_charset(std::array const &chars) noexcept : basic_charset() { static_assert(count_characters > 0, "Character array cannot be empty"); - for (std::size_t i = 0; i < count_characters - 1; ++i) { // count_characters - 1 to exclude the null terminator + for (std::size_t i = 0; i != count_characters; ++i) { char_type c = chars[i]; bitset_._u64s[sz_bitcast(sz_u8_t, c) >> 6] |= (1ull << (sz_bitcast(sz_u8_t, c) & 63u)); }