Or consider using a set/map instead so you always have distinct items...

By on 8/9/2010 1:04 PM ()

>> Because lists are immutable...

That does make sense; I hadn't considered that aspect. Thanks.

-Neil

By on 8/9/2010 2:31 PM ()

Because lists are immutable, you can't get distinct items w/o allocating a new list (ok - you could share a tail in some cases...), so you don't lose much by using Seq.Distinct and doing a |> ToList.
(Of course, if List.Distinct is really what you want and it's in a 4-nested loop in your engine, then you should probably code one that as efficient as possible.)

By on 8/9/2010 1:02 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper