Przeglądaj źródła

Add Remove method to Dictionary Enumerators

disarray2077 4 lat temu
rodzic
commit
709997feb1
1 zmienionych plików z 21 dodań i 0 usunięć
  1. 21 0
      BeefLibs/corlib/src/Collections/Dictionary.bf

+ 21 - 0
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