vim-patch:9.1.0824: too many strlen() calls in register.c (#31022)

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

closes: vim/vim#15952

79f6ffd388

Co-authored-by: John Marriott <basilisk@internode.on.net>
This commit is contained in:
zeertzjq
2024-11-01 17:34:19 +08:00
committed by GitHub
parent 9b357e30fd
commit cbd8b2c162
6 changed files with 152 additions and 126 deletions

View File

@@ -105,7 +105,7 @@ enum GRegFlags {
/// Definition of one register
typedef struct {
char **y_array; ///< Pointer to an array of line pointers.
String *y_array; ///< Pointer to an array of Strings.
size_t y_size; ///< Number of lines in y_array.
MotionType y_type; ///< Register type
colnr_T y_width; ///< Register width (only valid for y_type == kBlockWise).