Is there any syntatic sugar for a loop used just to count iterations? For example
int count = randomNumber;
List<X> objectXList = new List<X>();
//Add a new object to objectXList count times
//
for(int i=0; i<count ; i++)
{
objectXList.Add(new X());
}
Enumerable.Range returns a specified number of integers starting at a given value. In your case Enumerable.Range starting at 0 would work, for a length
count.or maybe better yet, for all of the micro-optimizers out there: