Call LineStartPosition(pos)
is expensive inside both function.
For MovePositionOutsideChar()
function, posStartLine
can be removed: when pos
is at line start, its previous character can only be CR, LF or NUL, which is not lead byte, so following code is empty loop.
Patch for
MovePositionOutsideChar()
:Not yet figure out how to eliminate
posStartLine
inNextPosition()
.Patch also removes
posStartLine
forNextPosition()
:even with this change, DBCS backward brace match using
NextPosition()
is still much slower than usingMovePositionOutsideChar()
.Committed with [24545b] and [2c0dbb].
Related
Commit: [24545b]
Commit: [2c0dbb]