Esempio n. 1
0
        /// <summary>
        ///     Returns a list of all the values contained in this lookup and adds the lookup to the disposal queue.
        ///     Items in the list will be ordered based on the ordering of the key list, then by the position within value list for the item's key.
        ///     Ownership of the returned nodes is transferred to the caller, who is responsible for their disposal.
        /// </summary>
        public LinkedHeadTail <T> FlattenAndDispose()
        {
            var values = new LinkedHeadTail <T>();
            var runner = keys.head;

            while (runner != null)
            {
                values.Append(RemoveValues(runner.value));
                runner = runner.next;
            }

            keys.DisposeInBackground();
            DisposeInBackground();

            return(values);
        }