diff options
author | Neil <nyamatongwe@gmail.com> | 2025-05-16 11:40:29 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2025-05-16 11:40:29 +1000 |
commit | d740cae0763d8b3730836e9bd558bf44c5e41eb6 (patch) | |
tree | 92ae465608ccca3de98e434fe2b65feeb00eb1ad | |
parent | 58c1443c64fb3c42b22e6184c81ee3d6fa42edab (diff) | |
download | scintilla-mirror-d740cae0763d8b3730836e9bd558bf44c5e41eb6.tar.gz |
Silence warning with intermediate constant.
-rw-r--r-- | src/Document.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
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<size_t>(UTF8MaxBytes - 1, text.length()); + constexpr int UTF8MaxTrail = UTF8MaxBytes - 1; + const size_t maxTrail = std::max<size_t>(UTF8MaxTrail, text.length()); size_t trail = 1; while (trail < maxTrail && UTF8IsTrailByte(text[text.length() - trail])) { trail++; |