Let's say I have a simple function that I can write in several ways:
// Using a proper function body
private static string FormatViewTitle([CanBeNull] string title)
{
return title is not null? string.Join(' ', ViewTitlePrefix, "-", title) : ViewTitlePrefix;
}
// Using a lambda expresion
private static string FormatViewTitle([CanBeNull] string title) =>
title is not null
? string.Join(' ', ViewTitlePrefix, "-", title)
: ViewTitlePrefix;
Does the compiler do extra optimizations if using the latter?