Optimize copying elements from one list to another

Issue #55 resolved
Stefan Glienke repo owner created an issue

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)

  1. Log in to comment