0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 9.1.0851: too many strlen() calls in getchar.c

Problem:  too many strlen() calls in getchar.c
Solution: refactor code and reduce strlen() calls
          (John Marriott)

closes: #16017

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-11-11 20:40:33 +01:00
committed by Christian Brabandt
parent 56d45f1b66
commit e7a1bbf210
3 changed files with 65 additions and 40 deletions

View File

@@ -573,6 +573,7 @@ typedef struct buffheader buffheader_T;
struct buffblock
{
buffblock_T *b_next; // pointer to next buffblock
size_t b_strlen; // length of b_str, excluding the NUL
char_u b_str[1]; // contents (actually longer)
};
@@ -585,6 +586,7 @@ struct buffheader
buffblock_T *bh_curr; // buffblock for appending
int bh_index; // index for reading
int bh_space; // space in bh_curr for appending
int bh_create_newblock; // create a new block?
};
typedef struct