From e86b5c8bc0101bee0c4b2e5e0ca80757f5cf78f5 Mon Sep 17 00:00:00 2001 From: Violeta Georgieva Date: Fri, 14 Jun 2024 09:21:46 +0300 Subject: [PATCH] Simplify --- reactor-pool/src/main/java/reactor/pool/SimpleDequePool.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactor-pool/src/main/java/reactor/pool/SimpleDequePool.java b/reactor-pool/src/main/java/reactor/pool/SimpleDequePool.java index d4f8cd5..34c7e16 100644 --- a/reactor-pool/src/main/java/reactor/pool/SimpleDequePool.java +++ b/reactor-pool/src/main/java/reactor/pool/SimpleDequePool.java @@ -585,10 +585,10 @@ void pendingOffer(Borrower pending) { postOffer = PENDING_SIZE.incrementAndGet(this); } - boolean noIdle = idleSize == 0; + int idle = idleSize; int estimatePermitCount = poolConfig.allocationStrategy().estimatePermitCount(); - if (noIdle && (estimatePermitCount == 0 || estimatePermitCount < postOffer)) { + if (idle + estimatePermitCount < postOffer) { pending.pendingAcquireStart = clock.millis(); if (!pending.pendingAcquireTimeout.isZero()) { pending.timeoutTask = config().pendingAcquireTimer().apply(pending, pending.pendingAcquireTimeout);