From 4db72474ccc799b6f39bb37604154cbcf33e08be Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 13 Apr 2026 11:31:36 +1000 Subject: Copy AnyOf from Lexilla to clarify code checking if a value is in a set. --- src/Document.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Document.cxx') diff --git a/src/Document.cxx b/src/Document.cxx index d4754233e..8e9c7d8c4 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -3010,7 +3010,7 @@ Sci::Position Document::BraceMatch(Sci::Position position, Sci::Position /*maxRe return -1; const int styBrace = StyleIndexAt(position); int direction = -1; - if (chBrace == '(' || chBrace == '[' || chBrace == '{' || chBrace == '<') + if (AnyOf(chBrace, '(', '[', '{', '<')) direction = 1; int depth = 1; position = useStartPos ? startPos : position + direction; @@ -3023,7 +3023,7 @@ Sci::Position Document::BraceMatch(Sci::Position position, Sci::Position /*maxRe while ((position >= 0) && (position < LengthNoExcept())) { const unsigned char chAtPos = CharAt(position); - if (chAtPos == chBrace || chAtPos == chSeek) { + if (AnyOf(chAtPos, chBrace, chSeek)) { if (((position > GetEndStyled()) || (StyleIndexAt(position) == styBrace)) && (chAtPos <= maxSafeChar || position == MovePositionOutsideChar(position, direction, false))) { depth += (chAtPos == chBrace) ? 1 : -1; -- cgit v1.2.3