perf(compiler-core): simplify advancePositionWithMutation (#564)

This commit is contained in:
djy0 2019-12-31 00:25:06 +08:00 committed by Evan You
parent 9996d7acbc
commit ad2a0bde98

View File

@ -149,7 +149,7 @@ export function advancePositionWithMutation(
pos.column = pos.column =
lastNewLinePos === -1 lastNewLinePos === -1
? pos.column + numberOfCharacters ? pos.column + numberOfCharacters
: Math.max(1, numberOfCharacters - lastNewLinePos) : numberOfCharacters - lastNewLinePos
return pos return pos
} }