aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-03-12 07:20:22 +0800
committerGitHub <noreply@github.com>2024-03-12 07:20:22 +0800
commitb02a4d8ac39bafdbfd490bfbab35e3202e6f709c (patch)
tree8105a504be98b7ad89efa1ac8264e1680ed2f990 /src/nvim/eval.c
parent59e3bcfb00f18ce5ee6643f0c6d303afb6c7c046 (diff)
downloadrneovim-b02a4d8ac39bafdbfd490bfbab35e3202e6f709c.tar.gz
rneovim-b02a4d8ac39bafdbfd490bfbab35e3202e6f709c.tar.bz2
rneovim-b02a4d8ac39bafdbfd490bfbab35e3202e6f709c.zip
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 https://github.com/vim/vim/commit/bfcc895482c717c9f6d86890d789ec739c3016b4 Co-authored-by: John Marriott <basilisk@internode.on.net>
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 3d224bfa0f..e4ee254193 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -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;