vim-patch:9.1.0168: too many STRLEN() calls (#27823)

Problem:  too many STRLEN() calls
Solution: Make use of ml_get_len() calls instead
          (John Marriott)

closes: vim/vim#14123

bfcc895482

Co-authored-by: John Marriott <basilisk@internode.on.net>
This commit is contained in:
zeertzjq
2024-03-12 07:20:22 +08:00
committed by GitHub
parent 59e3bcfb00
commit b02a4d8ac3
4 changed files with 20 additions and 21 deletions

View File

@@ -6699,7 +6699,7 @@ pos_T *var2fpos(const typval_T *const tv, const bool dollar_lnum, int *const ret
if (charcol) {
len = mb_charlen(ml_get(pos.lnum));
} else {
len = (int)strlen(ml_get(pos.lnum));
len = ml_get_len(pos.lnum);
}
// We accept "$" for the column number: last column.
@@ -6789,7 +6789,7 @@ pos_T *var2fpos(const typval_T *const tv, const bool dollar_lnum, int *const ret
if (charcol) {
pos.col = (colnr_T)mb_charlen(get_cursor_line_ptr());
} else {
pos.col = (colnr_T)strlen(get_cursor_line_ptr());
pos.col = get_cursor_line_len();
}
}
return &pos;