DeleteFiles should use FileInfo methods

The FileInfo class exposes an Exists property and a Delete method. The DirectoryInfoExtensions.DeleteFiles method should use these rather than the File.Exists and File.Delete methods, since the pat...

Id #389 | Release: None | Updated: Feb 12, 2013 at 9:24 PM by richarddeeming | Created: Oct 12, 2010 at 6:25 PM by richarddeeming

DirectoryInfoExtensions.GetFiles is not lazy

The DirectoryInfoExtensions.GetFiles method builds a List<T> containing every matching file. If you're only looking for the first few matching files, this wastes time and memory.   You can use Sele...

Id #387 | Release: None | Updated: Feb 12, 2013 at 9:24 PM by richarddeeming | Created: Oct 12, 2010 at 6:21 PM by richarddeeming

Unintended boxing in "In<T>"

The two overloads of ObjectExtensions.In<T> call "item.Equals(t)", but as there is no IEquatable<T> constraint on the type parameter, this is equivalent to "((object)item).Equals((object)t)". If T ...

Id #386 | Release: None | Updated: Feb 12, 2013 at 9:24 PM by richarddeeming | Created: Oct 12, 2010 at 6:03 PM by richarddeeming

Duplication between ToString and ToCommaSeparatedList

The code in the EnumerableExtensions.ToString and EnumerableExtensions.ToCommaSeparatedList methods is virtually identical. You can simplify this to:   public static string ToString<T>(this IEnumer...

Id #385 | Release: None | Updated: Feb 12, 2013 at 9:24 PM by richarddeeming | Created: Oct 12, 2010 at 5:55 PM by richarddeeming

EnumerableExtensions.IsNullOrEmpty should use Any instead of Count

If you use ".Count() = 0" or ".Count() < 1", the entire sequence will be enumerated to return the total number of items. If you replace this with ".Any()", only the first item in the sequence will ...

Id #384 | Release: None | Updated: Feb 12, 2013 at 9:24 PM by purs | Created: Oct 12, 2010 at 5:48 PM by richarddeeming

  • 1-5 of 5 Work Items
    • Previous
    • 1
    • Next
    • Showing
    • All
    • Work Items