value · System

DictionaryIterator<K, V>

public value DictionaryIterator<K : IHashable<K>, V>

The pairs of a dictionary, in the table's order.

Kind
value
Namespace
System
Assembly
System.Core
Access
public
Source file
Dictionary.ant

Type parameters

NameConstraints
KIHashable<K>
Vany type

Constructors

new(Dictionary<K, V> map)
#

Properties

KeyValuePair<K, V> Current { get; }
#

read-only

Methods

Next() : bool
#

Private and internal members (2)

Dictionary<K, V> map
#

private

i32 slot
#

private

Source

DictionaryIterator<K, V> as Antril, decompiled from its Larva HIR.

System.DictionaryIterator.ant
// System.DictionaryIterator — System.Core (decompiled from Larva HIR)

into namespace System
{
	/// The pairs of a dictionary, in the table's order.
	public value DictionaryIterator<K : IHashable<K>, V>
	{
		Dictionary<K, V> map;
		i32 slot;

		public:
			new(Dictionary<K, V> map)
			{
				this.map = map;
				slot = -1;
			}

			Next() : bool
			{
				i32 slots = map.Slots;
				slot++;
				loop (slot < slots && !map.Holds(slot))
					slot++;
				return slot < slots;
			}

			KeyValuePair<K, V> Current
			{
				get => new KeyValuePair<K, V>(map.KeyAt(slot), map.ValueAt(slot));
			}
	}
}
Esc