While looking through some dll's with ILSpy I came across the following code:
void RenderFiles(List<List<string>> pdfFiles)
{
int num;
for (int i = 0; i < pdfFiles.Count; i = num + 1)
{
// ....
num = i;
}
}
The introduction of the num variable seems strange to me. Why would the compiler introduce an extra local variable?
The original code is just a simple loop, although it uses a count variable and not a foreach enumerator:
void RenderFiles(List<List<string>> pdfFiles)
{
for (int i = 0; i < pdfFiles.Count; i++)
{
}
}