Mercurial > vim
comparison src/proto/memline.pro @ 34434:89f9a7925fff v9.1.0138
patch 9.1.0138: too many STRLEN calls when getting a memline
Commit: https://github.com/vim/vim/commit/02d7a6c6cfceb3faf9c98fcb7c458760cd50d269
Author: John Marriott <basilisk@internode.on.net>
Date: Mon Feb 26 21:21:17 2024 +0100
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>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 26 Feb 2024 21:30:03 +0100 |
parents | 56a2af8c0980 |
children | 9e093c96dff6 |
comparison
equal
deleted
inserted
replaced
34433:f7438681c79b | 34434:89f9a7925fff |
---|---|
17 void ml_preserve(buf_T *buf, int message); | 17 void ml_preserve(buf_T *buf, int message); |
18 char_u *ml_get(linenr_T lnum); | 18 char_u *ml_get(linenr_T lnum); |
19 char_u *ml_get_pos(pos_T *pos); | 19 char_u *ml_get_pos(pos_T *pos); |
20 char_u *ml_get_curline(void); | 20 char_u *ml_get_curline(void); |
21 char_u *ml_get_cursor(void); | 21 char_u *ml_get_cursor(void); |
22 colnr_T ml_get_len(linenr_T lnum); | |
23 colnr_T ml_get_curline_len(void); | |
24 colnr_T ml_get_cursor_len(void); | |
25 colnr_T ml_get_buf_len(buf_T *buf, linenr_T lnum); | |
22 char_u *ml_get_buf(buf_T *buf, linenr_T lnum, int will_change); | 26 char_u *ml_get_buf(buf_T *buf, linenr_T lnum, int will_change); |
23 int ml_line_alloced(void); | 27 int ml_line_alloced(void); |
24 int ml_append(linenr_T lnum, char_u *line, colnr_T len, int newfile); | 28 int ml_append(linenr_T lnum, char_u *line, colnr_T len, int newfile); |
25 int ml_append_flags(linenr_T lnum, char_u *line, colnr_T len, int flags); | 29 int ml_append_flags(linenr_T lnum, char_u *line, colnr_T len, int flags); |
26 int ml_append_buf(buf_T *buf, linenr_T lnum, char_u *line, colnr_T len, int newfile); | 30 int ml_append_buf(buf_T *buf, linenr_T lnum, char_u *line, colnr_T len, int newfile); |