mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
*: Move some dictionary functions to typval.h and use char*
Also fixes buffer reusage in setmatches() and complete().
This commit is contained in:
@@ -82,7 +82,7 @@ void hash_clear_all(hashtab_T *ht, unsigned int off)
|
||||
/// used for that key.
|
||||
/// WARNING: Returned pointer becomes invalid as soon as the hash table
|
||||
/// is changed in any way.
|
||||
hashitem_T *hash_find(hashtab_T *ht, const char_u *key)
|
||||
hashitem_T *hash_find(const hashtab_T *const ht, const char_u *const key)
|
||||
{
|
||||
return hash_lookup(ht, (const char *)key, STRLEN(key), hash_hash(key));
|
||||
}
|
||||
@@ -99,7 +99,8 @@ hashitem_T *hash_find(hashtab_T *ht, const char_u *key)
|
||||
///
|
||||
/// @warning Returned pointer becomes invalid as soon as the hash table
|
||||
/// is changed in any way.
|
||||
hashitem_T *hash_find_len(hashtab_T *ht, const char *key, const size_t len)
|
||||
hashitem_T *hash_find_len(const hashtab_T *const ht, const char *const key,
|
||||
const size_t len)
|
||||
{
|
||||
return hash_lookup(ht, key, len, hash_hash_len(key, len));
|
||||
}
|
||||
@@ -115,7 +116,7 @@ hashitem_T *hash_find_len(hashtab_T *ht, const char *key, const size_t len)
|
||||
/// used for that key.
|
||||
/// WARNING: Returned pointer becomes invalid as soon as the hash table
|
||||
/// is changed in any way.
|
||||
hashitem_T *hash_lookup(hashtab_T *const ht,
|
||||
hashitem_T *hash_lookup(const hashtab_T *const ht,
|
||||
const char *const key, const size_t key_len,
|
||||
const hash_T hash)
|
||||
{
|
||||
|
Reference in New Issue
Block a user