You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2022/10/05 19:55:45 UTC

[GitHub] [cxf] reta commented on a diff in pull request #1003: Fix SortedArraySet remove, containsAll

reta commented on code in PR #1003:
URL: https://github.com/apache/cxf/pull/1003#discussion_r985260354


##########
core/src/main/java/org/apache/cxf/common/util/SortedArraySet.java:
##########
@@ -138,20 +142,21 @@ public boolean remove(Object o) {
             return false;
         }
         int idx = Arrays.binarySearch(tmp, o);
-        if (idx != -1) {

Review Comment:
   👍 



##########
core/src/main/java/org/apache/cxf/common/util/SortedArraySet.java:
##########
@@ -99,9 +103,9 @@ public boolean addAll(Collection<? extends T> c) {
         return val;
     }
     public boolean containsAll(Collection<?> c) {

Review Comment:
   We probably could make it even better by returning as early as possible (upon finding first non-containing element)?



##########
core/src/main/java/org/apache/cxf/common/util/SortedArraySet.java:
##########
@@ -71,25 +71,29 @@ private T[] newArray(int size) {
     }
 
     public boolean add(T o) {

Review Comment:
   👍 



##########
core/src/main/java/org/apache/cxf/common/util/SortedArraySet.java:
##########
@@ -99,9 +103,9 @@ public boolean addAll(Collection<? extends T> c) {
         return val;
     }
     public boolean containsAll(Collection<?> c) {

Review Comment:
   Since class is public, it could be used outside of CXF codebase ...



-- 
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: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org