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

◆ Remove()

void System.Collections.Specialized.ListDictionary.Remove ( object key)
inline

Implements System.Collections.IDictionary.

Definition at line 413 of file ListDictionary.cs.

414 {
415 if (key == null)
416 {
417 throw new ArgumentNullException("key");
418 }
419 version++;
420 DictionaryNode dictionaryNode = null;
421 DictionaryNode next;
422 for (next = head; next != null; next = next.next)
423 {
424 object key2 = next.key;
425 if ((comparer == null) ? key2.Equals(key) : (comparer.Compare(key2, key) == 0))
426 {
427 break;
428 }
429 dictionaryNode = next;
430 }
431 if (next != null)
432 {
433 if (next == head)
434 {
435 head = next.next;
436 }
437 else
438 {
439 dictionaryNode.next = next.next;
440 }
441 count--;
442 }
443 }

References System.Collections.IComparer.Compare(), System.Collections.Specialized.ListDictionary.comparer, System.Collections.Specialized.ListDictionary.count, System.Collections.Specialized.ListDictionary.head, System.Collections.Specialized.ListDictionary.DictionaryNode.key, System.key, System.Collections.Specialized.ListDictionary.DictionaryNode.next, and System.Collections.Specialized.ListDictionary.version.

Referenced by System.Collections.Specialized.HybridDictionary.Remove().