public FastDictionary <TKey, Tuple <bool, PooledElasticCircularBuffer <PartitionedStreamEvent <TKey, TPayload> > > > DequeueUntil( long timestamp) { var partitionedStreamEvents = new FastDictionary <TKey, Tuple <bool, PooledElasticCircularBuffer <PartitionedStreamEvent <TKey, TPayload> > > >(); int index = FastDictionary <TKey, ImpatienceSorter> .IteratorStart; while (this.sorters.Iterate(ref index)) { var entry = this.sorters.entries[index]; var streamEvents = entry.value.DequeueUntil(timestamp, out bool recheck); partitionedStreamEvents.Lookup(entry.key, out int insertIdx); partitionedStreamEvents.Insert(ref insertIdx, entry.key, Tuple.Create(recheck, streamEvents)); } return(partitionedStreamEvents); }