mbien commented on PR #5332: URL: https://github.com/apache/netbeans/pull/5332#issuecomment-1427330499
> Set was introduced to increase readability and for removeAll()/contains() calls. Reverted NB code didn't call `contains()` and taking a look at the `removeAll()` impl: https://github.com/openjdk/jdk/blob/1fec6b5953b51dae4be640d6e4e4f79136b9348d/src/java.base/share/classes/java/util/AbstractSet.java#L166-L182 `contains()` is only called if the `toRemove` collection is larger than the set, however this can't happen as far as I see since `toRemove` is built by going through the collection first - so it is always smaller. I do agree though that calling `set.removeAll(veryLargeList)` would potentially scale badly. But in the concrete cases here where we know how the list is build it should not cause this problem. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
