diff options
author | ZyX <kp-pav@yandex.ru> | 2017-04-14 23:57:44 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-04-15 00:00:22 +0300 |
commit | 31fd6d4bbf80d0f50893ab6144aa5eb70c95c351 (patch) | |
tree | e46728a072863ef6cf9672af1047e0f2b6d608f5 | |
parent | b54e5c220f0b1bff31ce65c6988f70cbb9780b5e (diff) | |
download | rneovim-31fd6d4bbf80d0f50893ab6144aa5eb70c95c351.tar.gz rneovim-31fd6d4bbf80d0f50893ab6144aa5eb70c95c351.tar.bz2 rneovim-31fd6d4bbf80d0f50893ab6144aa5eb70c95c351.zip |
eval/typval: Do not translate tv_clear argument, this is useless
-rw-r--r-- | src/nvim/eval/typval.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index b70554c1ef..d5177138b0 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1799,11 +1799,13 @@ static inline void _nothing_conv_dict_end(typval_T *const tv, #define TYPVAL_ENCODE_NAME nothing #define TYPVAL_ENCODE_FIRST_ARG_TYPE const void *const #define TYPVAL_ENCODE_FIRST_ARG_NAME ignored +#define TYPVAL_ENCODE_TRANSLATE_OBJECT_NAME #include "nvim/eval/typval_encode.c.h" #undef TYPVAL_ENCODE_SCOPE #undef TYPVAL_ENCODE_NAME #undef TYPVAL_ENCODE_FIRST_ARG_TYPE #undef TYPVAL_ENCODE_FIRST_ARG_NAME +#undef TYPVAL_ENCODE_TRANSLATE_OBJECT_NAME #undef TYPVAL_ENCODE_ALLOW_SPECIALS #undef TYPVAL_ENCODE_CONV_NIL @@ -1837,12 +1839,14 @@ static inline void _nothing_conv_dict_end(typval_T *const tv, /// @param[in,out] tv Value to free. void tv_clear(typval_T *const tv) { - static char *objname = NULL; // cached because gettext() is slow. #6437 - if (objname == NULL) { - objname = xstrdup(_("tv_clear() argument")); - } if (tv != NULL && tv->v_type != VAR_UNKNOWN) { - const int evn_ret = encode_vim_to_nothing(NULL, tv, objname); + // WARNING: do not translate the string here, gettext is slow and function + // is used *very* often. At the current state encode_vim_to_nothing() does + // not error out and does not use the argument anywhere. + // + // If situation changes and this argument will be used, translate it in the + // place where it is used. + const int evn_ret = encode_vim_to_nothing(NULL, tv, "tv_clear() argument"); (void)evn_ret; assert(evn_ret == OK); } |