private void GuessType(object param, IEnumerable vals, object type) { if (param == null) { throw new ArgumentNullException("param", "Type can not be guessed for a null value."); // Use 'nameof' expression } if (type == null) { throw new ArgumentNullException(string.Format("Empty type '{0}'", type.GetType())); // Use string interpolation + possible NRE } if (vals == null) { throw new ArgumentNullException("vals"); // Use 'nameof' expression } if (!(param.ToString() == "check")) // Simplify negative equality expression { } if (type == typeof(int)) // Possible unintended reference comparison { // Source: http://stackoverflow.com/questions/9234009/c-sharp-type-comparison-type-equals-vs-operator Type type = new TypeDelegator(typeof(int)); // Merge variables Console.WriteLine(type.Equals(typeof(int))); // Check for reference equality instead } bool serializable = (type != null && type is Abstraction); // Merge sequential checks }