From ce9ec5366ab200193140bbd060b948f62a10286b Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 28 Feb 2024 11:44:50 +1100 Subject: Add variant of UTF8Classify that takes a char* so that client code does not have to reinterpret_cast. Make functions in header constexpr. Prefer .data() to &[] since safer. Avoid else when not needed. --- src/Document.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Document.cxx') diff --git a/src/Document.cxx b/src/Document.cxx index 5f77ec2de..df4e570d0 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -2235,7 +2235,7 @@ Sci::Position Document::FindText(Sci::Position minPos, Sci::Position maxPos, con for (int b = 1; b < widthCharBytes; b++) { bytes[b] = cbView.CharAt(posIndexDocument + b); } - widthChar = UTF8Classify(reinterpret_cast(bytes), widthCharBytes) & UTF8MaskWidth; + widthChar = UTF8Classify(bytes, widthCharBytes) & UTF8MaskWidth; if (!indexSearch) { // First character widthFirstCharacter = widthChar; } -- cgit v1.2.3