You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/04/04 18:36:43 UTC

[camel] branch main updated: reacted on inspection "set.removeAll(list) calls may work slowly" (#9806)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new a056f0c7e93 reacted on inspection "set.removeAll(list) calls may work slowly" (#9806)
a056f0c7e93 is described below

commit a056f0c7e930fc985b784132b278e859dfea68c7
Author: dk2k <dk...@users.noreply.github.com>
AuthorDate: Tue Apr 4 21:36:36 2023 +0300

    reacted on inspection "set.removeAll(list) calls may work slowly" (#9806)
    
    Co-authored-by: dk2k <dk...@ya.ru>
---
 .../org/apache/camel/component/platform/http/PlatformHttpComponent.java | 2 +-
 .../camel/component/zookeepermaster/group/internal/ZooKeeperGroup.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpComponent.java b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpComponent.java
index 3bd47d51c89..be4d5c3e0cd 100644
--- a/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpComponent.java
+++ b/components/camel-platform-http/src/main/java/org/apache/camel/component/platform/http/PlatformHttpComponent.java
@@ -130,7 +130,7 @@ public class PlatformHttpComponent extends DefaultComponent implements RestConsu
                 }
             }
         });
-        httpEndpoints.removeAll(toRemove);
+        toRemove.forEach(httpEndpoints::remove);
     }
 
     /**
diff --git a/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/group/internal/ZooKeeperGroup.java b/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/group/internal/ZooKeeperGroup.java
index 5940415334d..a9815416151 100644
--- a/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/group/internal/ZooKeeperGroup.java
+++ b/components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/group/internal/ZooKeeperGroup.java
@@ -548,7 +548,7 @@ public class ZooKeeperGroup<T extends NodeState> implements Group<T> {
         List<String> fullPaths = children.stream().map(c -> ZKPaths.makePath(path, c)).collect(Collectors.toList());
 
         Set<String> removedNodes = new HashSet<>(currentData.keySet());
-        removedNodes.removeAll(fullPaths);
+        fullPaths.forEach(removedNodes::remove);
 
         for (String fullPath : removedNodes) {
             remove(fullPath);