[banshee/art-caching] [Hyena] Add Remove method to LruCache
- From: Gabriel Burt <gburt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee/art-caching] [Hyena] Add Remove method to LruCache
- Date: Sat, 5 Dec 2009 03:47:05 +0000 (UTC)
commit 846303643ce98434a4c49123533afdcbf15ee91a
Author: Gabriel Burt <gabriel burt gmail com>
Date: Fri Dec 4 19:41:34 2009 -0800
[Hyena] Add Remove method to LruCache
src/Libraries/Hyena/Hyena.Collections/LruCache.cs | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/Libraries/Hyena/Hyena.Collections/LruCache.cs b/src/Libraries/Hyena/Hyena.Collections/LruCache.cs
index 86b42fe..dae70dc 100644
--- a/src/Libraries/Hyena/Hyena.Collections/LruCache.cs
+++ b/src/Libraries/Hyena/Hyena.Collections/LruCache.cs
@@ -95,6 +95,16 @@ namespace Hyena.Collections
}
}
+ public void Remove (TKey key)
+ {
+ lock (cache) {
+ if (Contains (key)) {
+ ExpireItem (cache[key].Value);
+ cache.Remove (key);
+ }
+ }
+ }
+
public bool TryGetValue (TKey key, out TValue value)
{
lock (cache) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]