mirror of
https://github.com/neovim/neovim.git
synced 2025-10-13 13:26:06 +00:00
refactor(options): use hashy for finding options (#26573)
Problem: `findoption()` searches through the options[] table linearly for option names, even though hashy can be used to generate a compile-time hash table for it. Solution: Use hashy to generate a compile time hash table for finding options. This also allows handling option aliases, so we don't need separate options[] table entries for things like 'viminfo'.
This commit is contained in:
@@ -1943,7 +1943,7 @@ typval_T optval_as_tv(OptVal value, bool numbool)
|
||||
/// Set option "varname" to the value of "varp" for the current buffer/window.
|
||||
static void set_option_from_tv(const char *varname, typval_T *varp)
|
||||
{
|
||||
OptIndex opt_idx = findoption(varname);
|
||||
OptIndex opt_idx = find_option(varname);
|
||||
if (opt_idx == kOptInvalid) {
|
||||
semsg(_(e_unknown_option2), varname);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user