Optimize copying elements from one list to another
Issue #55
resolved
Currently when copying elements from one list to another there is no method such as GetRange in IList<T>. Using Skip(index).Take(count) is possible but creates an IEnumerable<T>. If using ToArray on that to pass to InsertRange does two "bad" things. First it puts out the elements one by one to the returned array and second it also does the same for InsertRange.
- TList<T>.InsertRange should be implemented to handle inserting an array better.
- IList<T> should get a method to easily get out a subrange of elements.
- IList<T> might get a CopyTo overload that takes an IList<T> (optional as the implementation of IList<T> might differ without direct access to the backing array)
Comments (7)
-
reporter -
reporter - changed status to resolved
added new method IList<T>.GetRange
→ <<cset 315468ee50e4>>
-
reporter - changed version to 1.1 (released)
-
reporter - changed version to 1.1 (master)
-
reporter - changed version to 1.1
-
reporter - changed milestone to 1.2 (next version)
-
reporter - changed milestone to 1.2
- Log in to comment
optimized AddRange and InsertRange for TList<T> (see issue
#55)→ <<cset d5370631ef6a>>