If I have a code like this:
string s = MyClass.GetString();
ProcessString(s);
Is it slower than?
ProcessString(MyClass.GetString());
If so, why? In the second example, the compiler usually makes a variable from GetString (); method that returns a string?
Also, what's the point of declaring variables as late as possible? Does this get the advantage of GC? If so, how (I assume in terms of GC gens)?
thanks
source
share