From 757606ffa7cbfa210d358d3ac765b55c4818f5ed Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Wed, 14 Aug 2019 10:48:54 +0200 Subject: [PATCH] cache: improve cache management MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I2a95154e728bf87976280b52ae0214664b107fd6 Signed-off-by: José Bollo --- src/cache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cache.c b/src/cache.c index 299d952..3b98c1e 100644 --- a/src/cache.c +++ b/src/cache.c @@ -107,8 +107,10 @@ drop_lre( while (iter < cache->used) { item = itemat(cache, iter); hit = item->hit; - if (hit < hmin) + if (hit <= hmin) { found = iter; + hmin = hit; + } iter += item->length; } if (found < cache->used) -- 2.16.6