Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Remove()

void System.Collections.ListDictionaryInternal.Remove ( object key)
inline

Implements System.Collections.IDictionary.

Definition at line 389 of file ListDictionaryInternal.cs.

390 {
391 if (key == null)
392 {
393 throw new ArgumentNullException("key", SR.ArgumentNull_Key);
394 }
395 version++;
396 DictionaryNode dictionaryNode = null;
397 DictionaryNode next = head;
398 while (next != null && !next.key.Equals(key))
399 {
400 dictionaryNode = next;
401 next = next.next;
402 }
403 if (next != null)
404 {
405 if (next == head)
406 {
407 head = next.next;
408 }
409 else
410 {
411 dictionaryNode.next = next.next;
412 }
413 count--;
414 }
415 }

References System.SR.ArgumentNull_Key, System.Collections.ListDictionaryInternal.count, System.Collections.ListDictionaryInternal.head, System.Collections.ListDictionaryInternal.DictionaryNode.key, System.key, System.Collections.ListDictionaryInternal.DictionaryNode.next, and System.Collections.ListDictionaryInternal.version.