From 709997feb1016fd33a755b94b21c7b7d29a71b27 Mon Sep 17 00:00:00 2001 From: disarray2077 <86157825+disarray2077@users.noreply.github.com> Date: Thu, 24 Jun 2021 20:04:56 -0300 Subject: [PATCH] Add Remove method to Dictionary Enumerators --- BeefLibs/corlib/src/Collections/Dictionary.bf | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/BeefLibs/corlib/src/Collections/Dictionary.bf b/BeefLibs/corlib/src/Collections/Dictionary.bf index 2bd9cc1f..66a4b312 100644 --- a/BeefLibs/corlib/src/Collections/Dictionary.bf +++ b/BeefLibs/corlib/src/Collections/Dictionary.bf @@ -864,6 +864,13 @@ namespace System.Collections mDictionary.mEntries[mCurrentIndex].mValue = value; } + public void Remove() mut + { + int_cosize curIdx = mIndex - 1; + mDictionary.Remove(mDictionary.mEntries[curIdx].mKey); + mIndex = curIdx; + } + public void Reset() mut { #if VERSION_DICTIONARY @@ -1005,6 +1012,13 @@ namespace System.Collections { } + public void Remove() mut + { + int_cosize curIdx = mIndex - 1; + mDictionary.Remove(mDictionary.mEntries[curIdx].mKey); + mIndex = curIdx; + } + public void Reset() mut { #if VERSION_DICTIONARY @@ -1101,6 +1115,13 @@ namespace System.Collections { } + public void Remove() mut + { + int_cosize curIdx = mIndex - 1; + mDictionary.Remove(mDictionary.mEntries[curIdx].mKey); + mIndex = curIdx; + } + public void Reset() mut { #if VERSION_DICTIONARY