I've been trying to optimize my code to make it a little more concise and readable and was hoping I wasn't causing poorer performance from doing it. I think my changes might have slowed down my application, but it might just be in my head. Is there any performance difference between:
Command.Parameters["@EMAIL"].Value = email ?? String.Empty;
and
Command.Parameters["@EMAIL"].Value = (email == null) ? String.Empty: email;
and
if (email == null)
{
Command.Parameters["@EMAIL"].Value = String.Empty
}
else
{
Command.Parameters["@EMAIL"].Value = email
}
My preference for readability would be the null coalescing operator, I just didn't want it to affect performance. Thanks!