private static Pair[] _TempBufferPairs_ToArrayAndClear() { var pairs_new = new Pair[_TempBufferPairs.Count]; var it = _TempBufferPairs.GetEnumerator(); for (var i = 0; it.MoveNext(); i++) { pairs_new[i] = it.Current; } _TempBufferPairs.Clear(); return(pairs_new); }