eval: Add comment regarding why special values are needed

This commit is contained in:
ZyX 2017-04-13 23:42:51 +03:00
parent b2942d1e72
commit 276ee1f7fb
2 changed files with 18 additions and 0 deletions

View File

@ -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 /// to compute the length with strlen() without
/// translating. /// 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 /// @return True if variable is read-only: either always or in sandbox when
/// sandbox is enabled, false otherwise. /// sandbox is enabled, false otherwise.
bool var_check_ro(const int flags, const char *name, 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 /// to compute the length with strlen() without
/// translating. /// 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. /// @return True if variable is fixed, false otherwise.
static bool var_check_fixed(const int flags, const char *name, static bool var_check_fixed(const int flags, const char *name,
size_t name_len) size_t name_len)

View File

@ -2050,6 +2050,12 @@ bool tv_islocked(const typval_T *const tv)
/// to compute the length with strlen() without /// to compute the length with strlen() without
/// translating. /// 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. /// @return true if variable is locked, false otherwise.
bool tv_check_lock(const VarLockStatus lock, const char *name, bool tv_check_lock(const VarLockStatus lock, const char *name,
size_t name_len) size_t name_len)