From b1dcfa8dc328644f2a68c5168130b9e66a842427 Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Tue, 17 Jun 2025 13:20:11 +1000 Subject: Feature [feature-requests:#1557]. Shorten expression. --- src/PositionCache.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index 1f3a803fc..d0fb6acf7 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -317,7 +317,7 @@ Interval LineLayout::SpanByte(int index) const noexcept { } int LineLayout::EndLineStyle() const noexcept { - return styles[numCharsBeforeEOL > 0 ? numCharsBeforeEOL-1 : 0]; + return styles[std::max(numCharsBeforeEOL - 1, 0)]; } void LineLayout::WrapLine(const Document *pdoc, Sci::Position posLineStart, Wrap wrapState, XYPOSITION wrapWidth) { -- cgit v1.2.3