[banshee] [Hyena] Fix LruCache item expiration
- From: Alexander Kojevnikov <alexk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] [Hyena] Fix LruCache item expiration
- Date: Mon, 15 Mar 2010 04:25:22 +0000 (UTC)
commit f995015160f13c75ec22699ef704c459eb4938d1
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date: Mon Mar 15 15:23:11 2010 +1100
[Hyena] Fix LruCache item expiration
We do want to have MaxCount items in the cache, not (MaxCount-1)
src/Libraries/Hyena/Hyena.Collections/LruCache.cs | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/Libraries/Hyena/Hyena.Collections/LruCache.cs b/src/Libraries/Hyena/Hyena.Collections/LruCache.cs
index ef80b23..a50e73c 100644
--- a/src/Libraries/Hyena/Hyena.Collections/LruCache.cs
+++ b/src/Libraries/Hyena/Hyena.Collections/LruCache.cs
@@ -91,7 +91,7 @@ namespace Hyena.Collections
misses++;
EnsureMinimumHitRatio ();
- if (Count >= max_count) {
+ if (Count > max_count) {
TKey expire = FindOldestEntry ();
ExpireItem (cache[expire].Value);
cache.Remove (expire);
@@ -137,8 +137,8 @@ namespace Hyena.Collections
private void EnsureMinimumHitRatio ()
{
- if (minimum_hit_ratio != null && Count >= MaxCount && HitRatio < minimum_hit_ratio) {
- MaxCount = Count + 1;
+ if (minimum_hit_ratio != null && Count > MaxCount && HitRatio < minimum_hit_ratio) {
+ MaxCount = Count;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]