I was writing an app, and for this piece of code(in the end of a method)
if (selectSdfDialog.ShowDialog() == DialogResult.OK)
{
Sdf = selectSdfDialog.FileName;
var regex = new Regex("[VQ]\\d{11}");
Serial = regex.Match(selectSdfDialog.SafeFileName).ToString();
}
Resharper gave me a hint to invert the if statement, bringing it to this
if (selectSdfDialog.ShowDialog() != DialogResult.OK) return;
Sdf = selectSdfDialog.FileName;
var regex = new Regex("[VQ]\\d{11}");
Serial = regex.Match(selectSdfDialog.SafeFileName).ToString();
My question is, is this working faster or somehow better, and if yes, what is the difference for the compiler?