1
0
forked from aniani/vim

patch 9.1.0824: too many strlen() calls in register.c

Problem:  too many strlen() calls in register.c
Solution: refactor code, add string_T struct to keep track
          of string lengths (John Marriott)

closes: #15952

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-10-31 10:06:54 +01:00
committed by Christian Brabandt
parent a68bd6f089
commit 79f6ffd388
6 changed files with 228 additions and 140 deletions

View File

@@ -367,6 +367,15 @@
} \
} while (0)
/*
* Free a string and set it's pointer to NULL and length to 0
*/
#define VIM_CLEAR_STRING(s) \
do { \
VIM_CLEAR(s.string); \
s.length = 0; \
} while (0)
// Whether a command index indicates a user command.
#define IS_USER_CMDIDX(idx) ((int)(idx) < 0)