From 6fd2610eecef99b05eb08c8e04bf67df112dd225 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Wed, 1 May 2024 23:39:49 +0200 Subject: [PATCH] Fix valgrind warning --- m-dict.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/m-dict.h b/m-dict.h index 34aec506..06820cbe 100644 --- a/m-dict.h +++ b/m-dict.h @@ -341,6 +341,7 @@ ARRAY_DEF(m_array_index, m_indexhash_t, M_POD_OPLIST) /* Populate the initial table with the 'empty' representation which is 0 */ \ for(m_index_t i = 0; i < M_D1CT_INITIAL_SIZE; i++) { \ map->index[i].index = 0; \ + map->index[i].hash = 0; \ } \ M_D1CT_CONTRACT(map); \ } \ @@ -442,8 +443,10 @@ ARRAY_DEF(m_array_index, m_indexhash_t, M_POD_OPLIST) h->index = index; \ \ /* First mark the extended space as empty */ \ - for(m_index_t i = oldSize ; i < newSize; i++) \ + for(m_index_t i = oldSize ; i < newSize; i++) { \ h->index[i].index = 0; \ + h->index[i].hash = 0; \ + } \ } \ \ /* Then let's rehash all the entries in their **exact** position. \