summaryrefslogtreecommitdiffstats
path: root/src/proto
diff options
context:
space:
mode:
authorJohn Marriott <basilisk@internode.on.net>2024-02-26 21:21:17 +0100
committerChristian Brabandt <cb@256bit.org>2024-02-26 21:25:03 +0100
commit02d7a6c6cfceb3faf9c98fcb7c458760cd50d269 (patch)
treee80dca75f8301ec9fbdf59936ce8842f5973c57f /src/proto
parent2c51e15b66a4be9b5134c495ef546479aaa89ce9 (diff)
patch 9.1.0138: too many STRLEN calls when getting a memlinev9.1.0138
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>
Diffstat (limited to 'src/proto')
-rw-r--r--src/proto/memline.pro4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/proto/memline.pro b/src/proto/memline.pro
index 3fa8707d80..eb21a7eecf 100644
--- a/src/proto/memline.pro
+++ b/src/proto/memline.pro
@@ -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);