#1951 refactor: replace linear proxy scan with lookup map in MultiProxyManager#1954
#1951 refactor: replace linear proxy scan with lookup map in MultiProxyManager#1954leedongkyu0407 wants to merge 1 commit into
Conversation
…ltiProxyManager
ebe2ba1 to
736266b
Compare
|
Thanks for the refactor, the O(n) to O(1) lookup and folding proxy identity into 1. Missing tests for the new
2. Mutable fields used in the hash key. Minor: the diff also carries unrelated reformatting in |
Closes #1951
Summary
Replace the O(n) linear scan in
getConfiguredProxy()with an O(1) map lookup by putting proxy identity on the type itself.Changes
equals/hashCodetoSCProxybased on identity fields only:protocolandaddress(lowercased),port,username,password. Excludescountry,area,location,status, andusage.Map<SCProxy, SCProxy>in bothconfigure()overloads and replacedgetConfiguredProxywithOptional.ofNullable(map.get(proxy))ProxyUtils.isSameProxyand its privatenormalizehelper, folding the logic intoSCProxy.equalsNotes
MultiProxyManagerTest: 13/13 passedProtocolTest.testBlockingfailure is pre-existing and unrelated to this changeFor all changes
#XXXXwhereXXXXis the issue number you are trying to resolve?mvn git-code-format:format-code -Dgcf.globPattern="**/*" -Dskip.format.code=false?For code changes
mvn clean verify?