Skip to content

Commit 62e1d8d

Browse files
Update HtmlData.cs
1 parent 34c8a1f commit 62e1d8d

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

class/HtmlData.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,9 @@ public void Set(string Name, string Value)
144144

145145
public void Delete(string Name)
146146
{
147-
List<NameValue> TmpNameValueList = new List<NameValue>();
148-
149-
foreach (NameValue nv in NameValueList)
150-
{
151-
if (nv.Name != Name)
152-
TmpNameValueList.Add(nv);
153-
}
154-
155-
NameValueList = TmpNameValueList;
147+
for (int i = NameValueList.Count - 1; i >= 0; i--)
148+
if (NameValueList[i].Name == Name)
149+
NameValueList.RemoveAt(i);
156150
}
157151

158152
public void DeleteByIndex(int Index)

0 commit comments

Comments
 (0)