but I thought extension methods would make things slow? been trying to avoid
them
Why would you think that? OK, in reality you could shave a few cycles
if you know you have List<Tby checking the length first
(SequenceEqual doesn't do this, although this could be a missed
opportunity - it could check if both operands implement IList, and
compare the length) - and because it is using the interface (rather
than direct to the sealed List<T>) it won't inline any of the fetches
- but this is rarely the most significant thing.
My advice: use the simplest code that clearly expresses what you want
to do. SequenceEqual does this; *if* you later find this is a
bottleneck, then tweak it (perhaps introduce a List<TSequenceEqual
extension method) - but until then you're optimising prematurely.
Marc