Exemplo n.º 1
0
            /// <inheritdoc />
            public StringDictionaryBuilder Append(string value)
            {
                if (value == null)
                {
                    NullBitmap.Append(0);
                    IndicesBuffer.Append(-1); // need something in the indices buffer to make sure it makes sense
                    NullCount++;
                    return(this);
                }


                var temp = new DictionaryEntry(value, Comparer, HashFunction);

                if (!Entries.TryGetValue(temp, out var index))
                {
                    index = NextIndex++;
                    Entries.Add(temp, index);
                    AppendStringToBuffer(value);
                }

                NullBitmap.Append(1);
                IndicesBuffer.Append(index);
                return(this);
            }