diff options
author | ZyX <kp-pav@yandex.ru> | 2016-08-20 23:14:50 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-29 10:07:43 +0300 |
commit | 983a5532ca17060508ea308a9b7069dae4facb59 (patch) | |
tree | b09080e92bca1d477ed0ebb01d7058e6db6ca363 /src/nvim/eval.c | |
parent | ecff8387f465bbf5d57de09498059ff1de671131 (diff) | |
download | rneovim-983a5532ca17060508ea308a9b7069dae4facb59.tar.gz rneovim-983a5532ca17060508ea308a9b7069dae4facb59.tar.bz2 rneovim-983a5532ca17060508ea308a9b7069dae4facb59.zip |
eval: Move dict_set_keys_readonly to typval.c
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 8d6b6d2dc1..afbb93ef92 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -5605,19 +5605,6 @@ int dict_add_dict(dict_T *d, char *key, dict_T *dict) return OK; } -/// Set all existing keys in "dict" as read-only. -/// -/// This does not protect against adding new keys to the Dictionary. -/// -/// @param dict The dict whose keys should be frozen -void dict_set_keys_readonly(dict_T *const dict) - FUNC_ATTR_NONNULL_ALL -{ - TV_DICT_ITER(dict, di, { - di->di_flags |= DI_FLAGS_RO | DI_FLAGS_FIX; - }); -} - /* * Allocate a variable for a Dictionary and fill it from "*arg". * Return OK or FAIL. Returns NOTDONE for {expr}. @@ -18083,7 +18070,7 @@ void set_vim_var_dict(const VimVarIndex idx, dict_T *const val) if (val != NULL) { val->dv_refcount++; // Set readonly - dict_set_keys_readonly(val); + tv_dict_set_keys_readonly(val); } } |