From bbf057a59c430588085767f63e86bf19f92605a1 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 2 Jun 2025 10:47:53 +0200 Subject: [PATCH] GetValueAlt --- BeefLibs/corlib/src/Collections/Dictionary.bf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BeefLibs/corlib/src/Collections/Dictionary.bf b/BeefLibs/corlib/src/Collections/Dictionary.bf index 5c531e06..38cfd281 100644 --- a/BeefLibs/corlib/src/Collections/Dictionary.bf +++ b/BeefLibs/corlib/src/Collections/Dictionary.bf @@ -269,6 +269,13 @@ namespace System.Collections return .Err; } + public Result GetValueAlt(TAltKey key) where TAltKey : IHashable where bool : operator TKey == TAltKey + { + int_cosize i = (int_cosize)FindEntryAlt(key); + if (i >= 0) return mEntries[i].mValue; + return .Err; + } + public void Clear() { if (mCount > 0)