Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreateRanges() [2/2]

static IEnumerable< Tuple< long, long > > System.Collections.Concurrent.Partitioner< TSource >.CreateRanges ( long fromInclusive,
long toExclusive,
long rangeSize )
inlinestaticprivateinherited

Definition at line 840 of file Partitioner.cs.

841 {
842 bool shouldQuit = false;
843 for (long i = fromInclusive; i < toExclusive; i += rangeSize)
844 {
845 if (shouldQuit)
846 {
847 break;
848 }
849 long item = i;
850 long num;
851 try
852 {
853 num = checked(i + rangeSize);
854 }
855 catch (OverflowException)
856 {
857 num = toExclusive;
858 shouldQuit = true;
859 }
860 if (num > toExclusive)
861 {
862 num = toExclusive;
863 }
864 yield return new Tuple<long, long>(item, num);
865 }
866 }

References System.item.

Referenced by System.Collections.Concurrent.Partitioner< TSource >.Create(), System.Collections.Concurrent.Partitioner< TSource >.Create(), System.Collections.Concurrent.Partitioner< TSource >.Create(), and System.Collections.Concurrent.Partitioner< TSource >.Create().