diff options
author | ZyX <kp-pav@yandex.ru> | 2017-04-13 23:42:51 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-04-14 23:58:46 +0300 |
commit | 276ee1f7fb989b931a9ddfabfd4aaf1782bcbb77 (patch) | |
tree | 01f6cc27f9d6295b01614c194e479cfa271f9337 /src/nvim/eval/typval.c | |
parent | b2942d1e729c4cfa8ec9d3bedcdc7ad838a689ef (diff) | |
download | rneovim-276ee1f7fb989b931a9ddfabfd4aaf1782bcbb77.tar.gz rneovim-276ee1f7fb989b931a9ddfabfd4aaf1782bcbb77.tar.bz2 rneovim-276ee1f7fb989b931a9ddfabfd4aaf1782bcbb77.zip |
eval: Add comment regarding why special values are needed
Diffstat (limited to 'src/nvim/eval/typval.c')
-rw-r--r-- | src/nvim/eval/typval.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index c29c67124f..b70554c1ef 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -2050,6 +2050,12 @@ bool tv_islocked(const typval_T *const tv) /// to compute the length with strlen() without /// translating. /// +/// Both #TV_… values are used for optimization purposes: +/// variable name with its length is needed only in case +/// of error, when no error occurs computing them is +/// a waste of CPU resources. This especially applies to +/// gettext. +/// /// @return true if variable is locked, false otherwise. bool tv_check_lock(const VarLockStatus lock, const char *name, size_t name_len) |