]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.0038: Unnecessary loop in getvcol() v9.1.0038
authorzeertzjq <zeertzjq@outlook.com>
Wed, 17 Jan 2024 19:52:13 +0000 (20:52 +0100)
committerChristian Brabandt <cb@256bit.org>
Wed, 17 Jan 2024 19:52:13 +0000 (20:52 +0100)
commit4ea37f88e8345ca830271636a2e197a1a46114d2
tree36d1f16e8ec41f03766fbff8028fd4625fd5cb9a
parent5b0722b86445158f0b502ffc48a5847b0d0187bd
patch 9.1.0038: Unnecessary loop in getvcol()

Problem:  Unnecessary loop in getvcol().
Solution: Compare next char position with pos->col directly.
          (zeertzjq)

The loop below already handles end of line before checking for posptr,
and the next char is after pos->col whether pos->col is at the start or
in the middle of the char in question, so neither the NUL check nor the
mb_head_off() are needed when comparing the position of the next char
with pos->col directly.

closes: #13878

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/charset.c
src/version.c