From dde21314e75acdaeff27af70077f283493401961 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 15 Aug 2008 10:24:04 +0000 Subject: Update svn properties, formatting cleanup, fix a couple compiler warnings. --- OpenSim/Framework/Cache.cs | 58 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Cache.cs b/OpenSim/Framework/Cache.cs index 8d93d3e..4746d3c 100644 --- a/OpenSim/Framework/Cache.cs +++ b/OpenSim/Framework/Cache.cs @@ -173,8 +173,8 @@ namespace Opensim.Framework public class Cache { private List m_Index = new List(); - private Dictionary m_Lookup = - new Dictionary(); + private Dictionary m_Lookup = + new Dictionary(); private CacheStrategy m_Strategy; private CacheMedium m_Medium; @@ -270,10 +270,10 @@ namespace Opensim.Framework m_Index.RemoveRange(newSize, Count - newSize); m_Size = newSize; - m_Lookup.Clear(); + m_Lookup.Clear(); - foreach (CacheItemBase item in m_Index) - m_Lookup[item.uuid] = item; + foreach (CacheItemBase item in m_Index) + m_Lookup[item.uuid] = item; } } @@ -291,8 +291,8 @@ namespace Opensim.Framework lock (m_Index) { - if(m_Lookup.ContainsKey(index)) - item = m_Lookup[index]; + if (m_Lookup.ContainsKey(index)) + item = m_Lookup[index]; } if (item == null) @@ -340,10 +340,10 @@ namespace Opensim.Framework { CacheItemBase missing = new CacheItemBase(index); if (!m_Index.Contains(missing)) - { + { m_Index.Add(missing); - m_Lookup[index] = missing; - } + m_Lookup[index] = missing; + } } } return null; @@ -354,17 +354,17 @@ namespace Opensim.Framework return data; } - // Find an object in cache by delegate. - // - public Object Find(Predicate d) - { - CacheItemBase item = m_Index.Find(d); + // Find an object in cache by delegate. + // + public Object Find(Predicate d) + { + CacheItemBase item = m_Index.Find(d); - if(item == null) - return null; + if (item == null) + return null; - return item.Retrieve(); - } + return item.Retrieve(); + } public virtual void Store(LLUUID index, Object data) { @@ -421,7 +421,7 @@ namespace Opensim.Framework item.expires = DateTime.Now + m_DefaultTTL; m_Index.Add(item); - m_Lookup[index] = item; + m_Lookup[index] = item; } item.Store(data); } @@ -439,10 +439,10 @@ namespace Opensim.Framework { if (item.expires.Ticks == 0 || item.expires <= now) - { + { m_Index.Remove(item); - m_Lookup.Remove(item.uuid); - } + m_Lookup.Remove(item.uuid); + } } } @@ -471,20 +471,20 @@ namespace Opensim.Framework foreach (CacheItemBase i in candidates) { if (doExpire(i.uuid)) - { + { m_Index.Remove(i); - m_Lookup.Remove(i.uuid); - } + m_Lookup.Remove(i.uuid); + } } } else { m_Index.RemoveRange(target, Count - target); - m_Lookup.Clear(); + m_Lookup.Clear(); - foreach (CacheItemBase item in m_Index) - m_Lookup[item.uuid] = item; + foreach (CacheItemBase item in m_Index) + m_Lookup[item.uuid] = item; } } break; -- cgit v1.1