mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 9.1.0256: Finding autocmd events is inefficient
Problem: Finding autocmd events is inefficient Solution: Use binary search to find events, cache last found events, avoid use of strlen(), add SessionWritePost autocmd, fix test_codestyle and avoid endless loop (John Marriott) closes: #14287 Signed-off-by: John Marriott <basilisk@internode.on.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
16cdfa69e0
commit
78d742ab88
@@ -5060,3 +5060,18 @@ typedef struct {
|
||||
linenr_T spv_capcol_lnum; // line number for "cap_col"
|
||||
#endif
|
||||
} spellvars_T;
|
||||
|
||||
// Return the length of a string literal
|
||||
#define STRLEN_LITERAL(s) (sizeof(s) - 1)
|
||||
|
||||
// Store a key/value pair
|
||||
typedef struct
|
||||
{
|
||||
int key; // the key
|
||||
char *value; // the value string
|
||||
size_t length; // length of the value string
|
||||
} keyvalue_T;
|
||||
|
||||
#define KEYVALUE_ENTRY(k, v) \
|
||||
{(k), (v), STRLEN_LITERAL(v)}
|
||||
|
||||
|
Reference in New Issue
Block a user