From d740cae0763d8b3730836e9bd558bf44c5e41eb6 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 16 May 2025 11:40:29 +1000 Subject: Silence warning with intermediate constant. --- src/Document.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Document.cxx b/src/Document.cxx index 8be87dca1..e6f8f3543 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1216,7 +1216,8 @@ void DiscardEndFragment(std::string_view &text) noexcept { text.remove_suffix(1); } else if (UTF8IsTrailByte(text.back())) { // go back to the start of last character. - const size_t maxTrail = std::max(UTF8MaxBytes - 1, text.length()); + constexpr int UTF8MaxTrail = UTF8MaxBytes - 1; + const size_t maxTrail = std::max(UTF8MaxTrail, text.length()); size_t trail = 1; while (trail < maxTrail && UTF8IsTrailByte(text[text.length() - trail])) { trail++; -- cgit v1.2.3