Example #1
0
        public DefaultHeaders <TKey, TValue> Copy()
        {
            var copy = new DefaultHeaders <TKey, TValue>(this.hashingStrategy, this.ValueConverter, this.nameValidator, this.entries.Length);

            copy.AddImpl(this);
            return(copy);
        }
Example #2
0
 public HeaderEnumerator(DefaultHeaders <TKey, TValue> headers)
 {
     _head  = headers._head;
     _size  = headers._size;
     _node  = _head;
     _index = 0;
 }
Example #3
0
 public HeaderEnumerator(DefaultHeaders <TKey, TValue> headers)
 {
     this.head  = headers.head;
     this.size  = headers.size;
     this.node  = this.head;
     this.index = 0;
 }
Example #4
0
            public ValueEnumerator(DefaultHeaders <TKey, TValue> headers, TKey name)
            {
                if (name == null)
                {
                    ThrowArgumentNullException(nameof(name));
                }

                this.hashingStrategy = headers.hashingStrategy;
                this.hash            = this.hashingStrategy.HashCode(name);
                this.name            = name;
                this.node            = this.head = headers.entries[headers.Index(this.hash)];
                this.current         = default(TValue);
            }
Example #5
0
            public ValueEnumerator(DefaultHeaders <TKey, TValue> headers, TKey name)
            {
                if (name is null)
                {
                    CThrowHelper.ThrowArgumentNullException(CExceptionArgument.name);
                }

                _hashingStrategy = headers._hashingStrategy;
                _hash            = _hashingStrategy.HashCode(name);
                _name            = name;
                _node            = _head = headers._entries[headers.Index(_hash)];
                _current         = default;
            }