浏览代码

Add Remove method to Dictionary Enumerators

disarray2077 4 年之前
父节点
当前提交
709997feb1
共有 1 个文件被更改,包括 21 次插入0 次删除
  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