Skip to content

Commit adee2f4

Browse files
committed
Change submission loop
1 parent 8475807 commit adee2f4

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/main/java/org/commonjava/util/jhttpc/INTERNAL/conn/ConnectionManagerCache.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,8 @@ private synchronized boolean doShutdown( Function<ConnectionManagerTracker, Bool
133133
try
134134
{
135135
ExecutorCompletionService<Boolean> svc = new ExecutorCompletionService<>( exec );
136-
137-
int submitted = 0;
138-
for ( ConnectionManagerTracker tracker : cache.values() )
139-
{
140-
svc.submit( () -> shutdownAction.apply( tracker ) );
141-
submitted++;
142-
}
143-
136+
int submitted = cache.size();
137+
cache.values().forEach( tracker -> svc.submit( () -> shutdownAction.apply( tracker ) ) );
144138
boolean result = true;
145139
for ( int i = 0; i < submitted; i++ )
146140
{

0 commit comments

Comments
 (0)