Skip to content

Commit 10012b1

Browse files
committed
Simplify code
1 parent 3f14970 commit 10012b1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

httpclient5/src/main/java/org/apache/hc/client5/http/impl/nio/H2SharingConnPool.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,9 @@ PoolEntry<T, C> lease() {
276276
return conn != null && conn.isOpen();
277277
})
278278
.min(Comparator.comparingLong(e -> e.getValue().get()))
279-
.map(Map.Entry::getKey)
280279
.map(e -> {
281-
entryMap.get(e).incrementAndGet();
282-
return e;
280+
e.getValue().incrementAndGet();
281+
return e.getKey();
283282
})
284283
.orElse(null);
285284
} finally {

0 commit comments

Comments
 (0)