The ToList() calls may not need to be everywhere, and at your discretion
may not be needed at all.

My habit with enumerables is to try to be thoughtfull about when they are
enumerated so I would have added ToList() calls when at one point or
another I noticed that we were enumerating the list more than once.

We can remove them if they are not serving the intended purpose or are
outside the style of the code base.

On Friday, January 4, 2013, Matt Burke wrote:

> In GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs:
>
> >          {
> > -            return VersionControl.QueryRootBranchObjects(RecursionType.Full).Select(b => b.Properties.RootItem.Item);
> > +            var recursionType = RecursionType.Full;
> > +            var branches = VersionControl.QueryRootBranchObjects(recursionType)
> > +                .Where(b => b.Properties.RootItem.IsDeleted == false)
> > +                .ToList();
> > +
> > +            var roots = branches.Where(b => b.Properties.ParentBranch == null).ToList();
> > +            var children = branches.Except(roots).ToList();
> > +
> > +            var wrapped = roots.Select(b => WrapperForBranchFactory.Wrap(b, children)).ToList();
>
> Why is there a .ToList() at each step?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/git-tfs/git-tfs/pull/274/files#r2556037>.
>
>