on C# list ordering I found this old debate on stack overflow: How to Sort a List<T> by a property in the object
I myself used to order lists the same as the most voted reply in above link:
List<Order> newList = oldList.OrderBy(o=>o.SomeProperty).ToList();
not thinking that this creates a whole new list in the memory. Hence the second most voted reply in above link offers itself as the best solution (.Sort with Comparison).
My question is, if changing the first solution will avoid memory duplication:
oldList = oldList.OrderBy(o=>o.SomeProperty).ToList();
or does this again create a new list in memory?
note:I tested already and ordering works this way, but I don't know how to check for (extra/new) memory usage.
Thank you M