0
0
mirror of https://github.com/vim/vim.git synced 2025-11-15 23:14:06 -05:00

patch 9.1.0138: too many STRLEN calls when getting a memline

Problem:  too many STRLEN calls when getting a memline
Solution: Optimize calls to STRLEN(), add a few functions in memline.c
          that return the byte length instead of relying on STRLEN()
          (John Marriott)

closes: #14052

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
John Marriott
2024-02-26 21:21:17 +01:00
committed by Christian Brabandt
parent 2c51e15b66
commit 02d7a6c6cf
4 changed files with 59 additions and 24 deletions

View File

@@ -19,6 +19,10 @@ char_u *ml_get(linenr_T lnum);
char_u *ml_get_pos(pos_T *pos);
char_u *ml_get_curline(void);
char_u *ml_get_cursor(void);
colnr_T ml_get_len(linenr_T lnum);
colnr_T ml_get_curline_len(void);
colnr_T ml_get_cursor_len(void);
colnr_T ml_get_buf_len(buf_T *buf, linenr_T lnum);
char_u *ml_get_buf(buf_T *buf, linenr_T lnum, int will_change);
int ml_line_alloced(void);
int ml_append(linenr_T lnum, char_u *line, colnr_T len, int newfile);