aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index e81378bcaa..281b80a915 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -18871,6 +18871,12 @@ static void set_var(const char *name, const size_t name_len, 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 read-only: either always or in sandbox when
/// sandbox is enabled, false otherwise.
bool var_check_ro(const int flags, const char *name,
@@ -18910,6 +18916,12 @@ bool var_check_ro(const int flags, const char *name,
/// 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 fixed, false otherwise.
static bool var_check_fixed(const int flags, const char *name,
size_t name_len)