示例#1
0
            public override ObjectInstance Next()
            {
                if (_position < _map.GetSize())
                {
                    var key   = _map._map.GetKey(_position);
                    var value = _map._map[key];

                    _position++;
                    return(new KeyValueIteratorPosition(_engine, key, value));
                }

                return(KeyValueIteratorPosition.Done);
            }
示例#2
0
            public override bool TryIteratorStep(out ObjectInstance nextItem)
            {
                if (_position < _map.GetSize())
                {
                    var key   = _map._map.GetKey(_position);
                    var value = _map._map[key];

                    _position++;
                    nextItem = new KeyValueIteratorPosition(_engine, key, value);
                    return(true);
                }

                nextItem = KeyValueIteratorPosition.Done;
                return(false);
            }