Q:

simplify linq query?

Can anyone simplify this to work very efficiently.... 
FileCompareLength myFileCompare1 = new FileCompareLength();
var queryList1Only3 = (from file in list1  select file).Except(list2, myFileCompare1 );
var queryList1Only33 = (from file in list2 select file).Except(list1, myFileCompare1 );
var difference1 = queryList1Only3.ToHashSet();
difference1.SymmetricExceptWith(queryList1Only33);
var query4 = difference1.AsEnumerable().OrderBy(x => x.Name);
if (query4.Count() > 0) {
    dest.WriteLine("Discrepancies in File Date:");
    foreach (var v in query4) {
        dest.WriteLine(v.Lengh+ "      " + v.FullName);
    }
}

and
public class FileCompareLength : System.Collections.Generic.IEqualityComparer<System.IO.FileInfo> {
    public FileCompareLength() { }
    public bool Equals(System.IO.FileInfo f1, System.IO.FileInfo f2) {
        return (f1.Length == f2.Length);
    }

    public int GetHashCode(System.IO.FileInfo fi) {
        return  fi.Length.GetHashCode();
    }
}

Any Suggestion??

A:

It appears that your goal is to get a list of files with unique lengths.  If so, I would go straight to the hash set (which gets used under the covers anyway if memory serves) and skip LINQ.
var uniqueFiles = new HashSet<FileInfo>(list1, new FileCompareLength());
uniqueFiles.SymmetricExceptWith(list2);
//you should now have the desired list.
//as mentioned in the comments, check for any items before sorting
if (uniqueFiles.Any())
{
    for (var file in uniqueFiles.OrderBy(x => x.Name))
    {
        //do stuff with file
    }
}

If you use the HashSet, you could also use Count since it would not involve iterating the entire collection as it did in your example, but I find that Any conveys intent just as well and is less likely to degrade performance due to small changes elsewhere.

