From: Daniel Stenberg Date: Mon, 22 Sep 2025 08:30:15 +0000 (+0200) Subject: hostip: remove unnecessary leftover INT_MAX check in Curl_dnscache_prune X-Git-Tag: rc-8_17_0-2~378 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=470611d76c118995c64d3b738f02b89b76da6c43;p=thirdparty%2Fcurl.git hostip: remove unnecessary leftover INT_MAX check in Curl_dnscache_prune The math already uses timediff_t so no need for the extra logic Ref: #18678 Closes #18680 --- diff --git a/lib/hostip.c b/lib/hostip.c index fd8f706e7f..da260d7130 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -279,13 +279,9 @@ void Curl_dnscache_prune(struct Curl_easy *data) /* Remove outdated and unused entries from the hostcache */ timediff_t oldest_ms = dnscache_prune(&dnscache->entries, timeout_ms, now); - if(Curl_hash_count(&dnscache->entries) > MAX_DNS_CACHE_SIZE) { - if(oldest_ms < INT_MAX) - /* prune the ones over half this age */ - timeout_ms = (int)oldest_ms / 2; - else - timeout_ms = INT_MAX/2; - } + if(Curl_hash_count(&dnscache->entries) > MAX_DNS_CACHE_SIZE) + /* prune the ones over half this age */ + timeout_ms = oldest_ms / 2; else break;