From cb20671cf60180e571328234ef5ff417adbc40f9 Mon Sep 17 00:00:00 2001 From: crocdialer Date: Sun, 29 Sep 2024 18:30:18 +0200 Subject: [PATCH] another minor fix in linear_hashmap --- include/vierkant/linear_hashmap.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/vierkant/linear_hashmap.hpp b/include/vierkant/linear_hashmap.hpp index 60a8f7f8..25923e8a 100644 --- a/include/vierkant/linear_hashmap.hpp +++ b/include/vierkant/linear_hashmap.hpp @@ -131,7 +131,11 @@ class linear_hashmap storage_item_t *item = m_storage.get(), *end = item + m_capacity; for(; item != end; ++item, ++output_ptr) { - if(item->key != key_t() && item->value) { *output_ptr = {item->key, *item->value}; } + if(item->key != key_t()) + { + output_ptr->key = item->key; + output_ptr->value = item->value ? *item->value : value_t(); + } else { *output_ptr = {}; } } }