paulk-asert commented on PR #2210:
URL: https://github.com/apache/groovy/pull/2210#issuecomment-2852406946
> > Also, was there anything in particular you used from `AbstractList`.
Wondering why not to use the more general `List` interface?
>
> cause partition_point is O(logn), suppose that element.get(i) is O(1). so
here we need a "random access" data store (such as an array).
>
> the java doc says for AbstractList:
>
> * This class provides a skeletal implementation of the {@link List}
> * interface to minimize the effort required to implement this interface
> * backed by a "random access" data store (such as an array)
>
> though there no actual limit in java collection framework.
In general, we would use List here. That makes it work for all lists. The
default is ArrayList which should have good performance but if the user wishes
to supply some other kind of list, they will be responsible for ensuring they
pick a list matching their performance requirements.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]