@@ -20,20 +20,20 @@ public sealed class MemoryCache : ICache
2020 {
2121 private static readonly ILog log = LogFactory . Instance . GetCurrentTypeLog ( ) ;
2222 private readonly IndexableCollection < CacheEntry > entries ;
23- private readonly UniqueIndex < String , CacheEntry > keyIndex ;
23+ private readonly UniqueIndex < string , CacheEntry > keyIndex ;
2424 private readonly NonUniqueIndex < DateTime , CacheEntry > absoluteExpirationIndex ;
2525 private readonly LimitedConcurrencyLevelTaskScheduler scheduler ;
2626 private readonly Timer timer ;
27- private Boolean disposed ;
27+ private bool disposed ;
2828
2929 /// <summary>
3030 ///
3131 /// </summary>
3232 /// <param name="maximumConcurrencyLevel"></param>
3333 /// <param name="timerPeriod"></param>
34- public MemoryCache ( Int32 maximumConcurrencyLevel , TimeSpan timerPeriod )
34+ public MemoryCache ( int maximumConcurrencyLevel , TimeSpan timerPeriod )
3535 {
36- this . keyIndex = new UniqueIndex < String , CacheEntry > (
36+ this . keyIndex = new UniqueIndex < string , CacheEntry > (
3737 "key" ,
3838 entry => GetKeyResponse . Create ( true , entry . CacheItem . Key ) ,
3939 SortOrder . None ) ;
@@ -69,13 +69,13 @@ void ICache.Add( ICacheItem item )
6969 entry = new CacheEntry
7070 {
7171 CacheItem = item ,
72- AbsoluteExpiration = OptimizedDateTime . Now + item . SlidingExpiration
72+ AbsoluteExpiration = LocalTime . Default . Now + item . SlidingExpiration
7373 } ;
7474
7575 this . entries . Add ( entry ) ;
7676 }
7777
78- Object value = item . GetValue ( ) ;
78+ object value = item . GetValue ( ) ;
7979 entry . Value = value ;
8080 entry . Initialized = true ;
8181 }
@@ -97,7 +97,7 @@ void ICache.AddOrGetExisiting( ICacheItem item )
9797 entry = new CacheEntry
9898 {
9999 CacheItem = item ,
100- AbsoluteExpiration = OptimizedDateTime . Now + item . SlidingExpiration
100+ AbsoluteExpiration = LocalTime . Default . Now + item . SlidingExpiration
101101 } ;
102102
103103 this . entries . Add ( entry ) ;
@@ -114,7 +114,7 @@ void ICache.AddOrGetExisiting( ICacheItem item )
114114 if ( ! entry . Initialized )
115115 {
116116 var stopwatch = Stopwatch . StartNew ( ) ;
117- Object value = item . GetValue ( ) ;
117+ object value = item . GetValue ( ) ;
118118 stopwatch . Stop ( ) ;
119119 entry . Value = value ;
120120 entry . Initialized = true ;
@@ -124,10 +124,10 @@ void ICache.AddOrGetExisiting( ICacheItem item )
124124 }
125125 }
126126
127- Boolean ICache . TryGetValue ( String key , out Object value )
127+ bool ICache . TryGetValue ( string key , out object value )
128128 {
129129 CacheEntry entry ;
130- Boolean contains = this . keyIndex . TryGetValue ( key , out entry ) ;
130+ bool contains = this . keyIndex . TryGetValue ( key , out entry ) ;
131131
132132 if ( contains )
133133 {
@@ -141,7 +141,7 @@ Boolean ICache.TryGetValue( String key, out Object value )
141141 return contains ;
142142 }
143143
144- void ICache . Remove ( String key )
144+ void ICache . Remove ( string key )
145145 {
146146 lock ( this . entries )
147147 {
@@ -182,12 +182,12 @@ public void Dispose()
182182 }
183183 }
184184
185- private void TimerCallback ( Object state )
185+ private void TimerCallback ( object state )
186186 {
187187 if ( this . entries . Count > 0 && ! disposed )
188188 {
189189 var enumerable = ( ICollection < CacheEntry > ) this . absoluteExpirationIndex ;
190- DateTime now = OptimizedDateTime . Now ;
190+ DateTime now = LocalTime . Default . Now ;
191191 ICollection < CacheEntry > expiredEntries ;
192192
193193 lock ( this . entries )
@@ -215,19 +215,19 @@ private void Update( CacheEntry entry )
215215 {
216216 var item = entry . CacheItem ;
217217 var stopwatch = Stopwatch . StartNew ( ) ;
218- Object value = item . GetValue ( ) ;
218+ object value = item . GetValue ( ) ;
219219 stopwatch . Stop ( ) ;
220220 log . Trace ( "Update, item.GetValue(), key: {0}, elapsed: {1}" , item . Key , stopwatch . Elapsed ) ;
221221
222222 var collection = ( ICollection < CacheEntry > ) this . absoluteExpirationIndex ;
223223
224224 lock ( this . entries )
225225 {
226- Boolean succeeded = collection . Remove ( entry ) ;
226+ bool succeeded = collection . Remove ( entry ) ;
227227 Contract . Assert ( succeeded , "collection.Remove( entry )" ) ;
228228
229229 entry . Value = value ;
230- entry . AbsoluteExpiration = OptimizedDateTime . Now + item . SlidingExpiration ;
230+ entry . AbsoluteExpiration = LocalTime . Default . Now + item . SlidingExpiration ;
231231
232232 collection . Add ( entry ) ;
233233 }
0 commit comments