Hypothetically the following situation:
one has to retrieve logfiles from a massive amount of folderstructures, and add these in a List.
Which scenario takes less resources from the machine?
LogFile file;
foreach (string filepath in folderfiles)
{
file = new LogFile { path = filepath,
machine = machineName,
user = userName };
files.Add(file);
}
or
foreach (string filepath in folderfiles)
{
LogFile logFile = new Logfile { path = filepath,
machine = machineName,
user = userName };
files.Add(file);
}
Would it even make any difference?