consider this code:
Does the compiler emit code to create a new action when the function is called or only when f() is actually called?Code:private void DoIf(bool b, Action f) { if (b) f(); } int x = 0; bool no = false; DoIf(no, () => x = 10);
consider this code:
Does the compiler emit code to create a new action when the function is called or only when f() is actually called?Code:private void DoIf(bool b, Action f) { if (b) f(); } int x = 0; bool no = false; DoIf(no, () => x = 10);