<commit_before>#include "ghash.h"

void* ghash_get(struct ghash* d, const void* key, unsigned long hash,
		ghash_cmp_fn* keycmp)
{
  const unsigned size = d->size;
  const unsigned start = hash % size;
  unsigned i = start;
  void** p = d->table + start;

  do {
    void* entry = *p;
    if (entry == 0) return 0;
    if (ghash_entry_hash(entry) == hash &&
	keycmp(key, ghash_entry_keyptr(entry)) == 0)
      return entry;
    if (++i >= size) i = 0, p = d->table;
  } while (i != start);
  return 0;
}<commit_msg>Remember to actually increment the slot pointer when probing.<commit_after>#include "ghash.h"

void* ghash_get(struct ghash* d, const void* key, unsigned long hash,
		ghash_cmp_fn* keycmp)
{
  const unsigned size = d->size;
  const unsigned start = hash % size;
  unsigned i = start;
  void** p = d->table + start;

  do {
    void* entry = *p;
    if (entry == 0) return 0;
    if (ghash_entry_hash(entry) == hash &&
	keycmp(key, ghash_entry_keyptr(entry)) == 0)
      return entry;
    ++p;
    if (++i >= size) i = 0, p = d->table;
  } while (i != start);
  return 0;
}
{'fraction_non_alphanumeric': 0.14903403863845446, 'fraction_numerical': 0.00919963201471941, 'mean_word_length': 3.200772200772201, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6293821', 'n_tokens_mistral': 418, 'n_tokens_neox': 398, 'n_words': 127}