[ 
https://issues.apache.org/jira/browse/GROOVY-11649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17949582#comment-17949582
 ] 

ASF GitHub Bot commented on GROOVY-11649:
-----------------------------------------

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.




> Create partitionPoint extension method variants
> -----------------------------------------------
>
>                 Key: GROOVY-11649
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11649
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 5.x
>
>
> See: https://github.com/apache/groovy/pull/2210
> * rust: 
> https://doc.rust-lang.org/std/primitive.slice.html#method.partition_point
> * c++: https://en.cppreference.com/w/cpp/algorithm/ranges/partition_point
> * python: https://docs.python.org/3/library/bisect.html#module-bisect



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to