public void TrimExcess()
        {
            var newLookup = new SerializableLookup <TKey, TElement>(Count, true);

            foreach (var g in this)
            {
                foreach (var item in g)
                {
                    newLookup.Add(g.Key, item);
                }
            }

            // copy internal field to this
            this.buckets         = newLookup.buckets;
            this.count           = newLookup.count;
            this.entriesHashCode = newLookup.entriesHashCode;
            this.entriesKey      = newLookup.entriesKey;
            this.entriesNext     = newLookup.entriesNext;
            this.entriesValue    = newLookup.entriesValue;
        }