Suppose I have some code like this:
public string SomeMethod(int Parameter)
{
string TheString = "";
TheString = SomeOtherMethod(Parameter);
return TheString;
}
Of course, this code is equivalent to this:
public string SomeMethod(int Parameter)
{
return SomeOtherMethod(Parameter);
}
I think the first version is more readable and that's how I'm writing my code, even thought I'm using a variable when I know I could avoid it. My question is this: does the compiler compile the code in the same way (ie same performance) or is the second option really better in terms of performance.
Thanks.