Skip to content

Commit 47fec5f

Browse files
committed
BasicStringLexer may use BasicStringClassifier::size for string size
1 parent bfc4c7e commit 47fec5f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fly/types/string/detail/string_lexer.hpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ class BasicStringLexer
101101
template <typename Condition>
102102
constexpr std::optional<char_type> consume_if(Condition condition);
103103

104-
static constexpr const auto s_null_terminator = FLY_CHR(char_type, '\0');
105-
106104
const std::size_t m_size;
107105
const view_type m_view;
108106

@@ -113,7 +111,7 @@ class BasicStringLexer
113111
template <typename StringType>
114112
template <std::size_t N>
115113
constexpr BasicStringLexer<StringType>::BasicStringLexer(const char_type (&literals)[N]) noexcept :
116-
m_size(N - ((literals[N - 1] == s_null_terminator) ? 1 : 0)),
114+
m_size(classifier::size(literals)),
117115
m_view(literals, m_size)
118116
{
119117
}

0 commit comments

Comments
 (0)