private void ConditionAsOk(object value) { UseIsOperatorTest test = (value as UseIsOperatorTest); if (test != null) { // 'is' would not be optimal since we use the 'as' result Console.WriteLine(test.ToString()); } }
private void ConditionSplitBad(object value) { UseIsOperatorTest test = (value as UseIsOperatorTest); // 'test' is unused after the test if (test != null) { Console.WriteLine("Bad"); } }