From: Brendan Hansen Date: Sun, 24 Apr 2022 04:15:53 +0000 (-0500) Subject: bugfix with set.get X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=c4b428c94de027ed7bf5c441a0e606ebfae99434;p=onyx.git bugfix with set.get --- diff --git a/core/container/set.onyx b/core/container/set.onyx index f9f28a8f..2738e292 100644 --- a/core/container/set.onyx +++ b/core/container/set.onyx @@ -85,7 +85,7 @@ has :: (use set: ^Set, value: set.Elem_Type) -> bool { get :: (use set: ^Set, value: set.Elem_Type) -> set.Elem_Type { lr := lookup(set, value); - return entries[lr.entry_index].value if lr.entry_index >= 0 else __zero_value(T); + return entries[lr.entry_index].value if lr.entry_index >= 0 else __zero_value(set.Elem_Type); } get_ptr :: (use set: ^Set, value: set.Elem_Type) -> ^set.Elem_Type {