mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 22:48:34 +00:00
feat(lua-api): avoid unnecessary allocations (#19877)
Lua makes (or reuses) an internal copy of strings, so we can safely push buf pointers onto the stack.
This commit is contained in:
@@ -3012,7 +3012,7 @@ int get_option_value_strict(char *name, int64_t *numval, char **stringval, int o
|
||||
|
||||
if (varp != NULL) {
|
||||
if (p->flags & P_STRING) {
|
||||
*stringval = xstrdup(*(char **)(varp));
|
||||
*stringval = *(char **)(varp);
|
||||
} else if (p->flags & P_NUM) {
|
||||
*numval = *(long *)varp;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user