Code inspection: Inline temporary variable
This inspection reports variables that only store the value of another variable or parameter without performing any other function. Such variables can be safely removed, and their usages can be replaced with the assigned variable. This reduces the unnecessary complexity of your code and makes it more readable.
void Sample(string output)
{
var toWrite = output;
Console.WriteLine(toWrite);
}
void Sample(string output)
{
Console.WriteLine(output);
}
Last modified: 14 May 2024