Showing posts with label resharper. Show all posts
Showing posts with label resharper. Show all posts

Monday, June 11, 2012

Does inverting the "if' improve performance?


I've been using ReSharper for a while now and sometimes it suggests that I invert the if . I guess an example would be a better explanation of my situation:

Sunday, June 10, 2012

Access to Modified Closure



string [] files = new string[2];
files[0] = "ThinkFarAhead.Example.Settings.Configuration_Local.xml";
files[1] = "ThinkFarAhead.Example.Settings.Configuration_Global.xml";

//Resharper complains this is an "access to modified closure"
for (int i = 0; i < files.Length; i++ )
{
// Resharper disable AccessToModifiedClosure
if(Array.Exists(Assembly.GetExecutingAssembly().GetManifestResourceNames(),
delegate(string name) { return name.Equals(files[i]); }))
return Assembly.GetExecutingAssembly().GetManifestResourceStream(files[i]);
// ReSharper restore AccessToModifiedClosure
}

Friday, May 18, 2012

Virtual member call in a constructor


I'm getting a warning from ReSharper about a call to a virtual member from my objects constructor. Why would this be something not to do?