aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/hashtab.c
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2021-09-20 18:35:41 +0200
committerGitHub <noreply@github.com>2021-09-20 09:35:41 -0700
commitf4ca3a29ddcb0c98e8e09c45a6342af709f8cc45 (patch)
tree054d1d35a890843504412b859249f0b0b0b4b810 /src/nvim/hashtab.c
parent1f8c91bf729707fdb005292aecca8dd79538f4a5 (diff)
downloadrneovim-f4ca3a29ddcb0c98e8e09c45a6342af709f8cc45.tar.gz
rneovim-f4ca3a29ddcb0c98e8e09c45a6342af709f8cc45.tar.bz2
rneovim-f4ca3a29ddcb0c98e8e09c45a6342af709f8cc45.zip
refactor: reformat with uncrustify #15736
* fix function parameter comments * remove space after star in function names
Diffstat (limited to 'src/nvim/hashtab.c')
-rw-r--r--src/nvim/hashtab.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/nvim/hashtab.c b/src/nvim/hashtab.c
index 526bc284a4..a8e5de839a 100644
--- a/src/nvim/hashtab.c
+++ b/src/nvim/hashtab.c
@@ -22,15 +22,15 @@
/// memory).
#include <assert.h>
+#include <inttypes.h>
#include <stdbool.h>
#include <string.h>
-#include <inttypes.h>
-#include "nvim/vim.h"
#include "nvim/ascii.h"
#include "nvim/hashtab.h"
-#include "nvim/message.h"
#include "nvim/memory.h"
+#include "nvim/message.h"
+#include "nvim/vim.h"
// Magic value for algorithm that walks through the array.
#define PERTURB_SHIFT 5
@@ -102,8 +102,7 @@ hashitem_T *hash_find(const hashtab_T *const ht, const char_u *const key)
///
/// @warning Returned pointer becomes invalid as soon as the hash table
/// is changed in any way.
-hashitem_T *hash_find_len(const hashtab_T *const ht, const char *const 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));
}
@@ -119,8 +118,7 @@ hashitem_T *hash_find_len(const hashtab_T *const ht, const char *const key,
/// used for that key.
/// WARNING: Returned pointer becomes invalid as soon as the hash table
/// is changed in any way.
-hashitem_T *hash_lookup(const hashtab_T *const ht,
- const char *const key, const size_t key_len,
+hashitem_T *hash_lookup(const hashtab_T *const ht, const char *const key, const size_t key_len,
const hash_T hash)
{
#ifdef HT_DEBUG
@@ -336,7 +334,7 @@ static void hash_may_resize(hashtab_T *ht, size_t minitems)
bool newarray_is_small = newsize == HT_INIT_SIZE;
bool keep_smallarray = newarray_is_small
- && ht->ht_array == ht->ht_smallarray;
+ && ht->ht_array == ht->ht_smallarray;
// Make sure that oldarray and newarray do not overlap,
// so that copying is possible.
@@ -387,7 +385,7 @@ static void hash_may_resize(hashtab_T *ht, size_t minitems)
}
#define HASH_CYCLE_BODY(hash, p) \
- hash = hash * 101 + *p++
+ hash = hash * 101 + *p++
/// Get the hash number for a key.
///