Skip to content
Browse files

more strict retrieval of records from InMemoryCache

  • Loading branch information...
1 parent 7c7362d commit 3cc24ec625e6007fd1bba6799852032326bb8e96 @abdullin abdullin committed Mar 12, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 Cqrs.Portable/TapeStorage/LockingInMemoryCache.cs
View
8 Cqrs.Portable/TapeStorage/LockingInMemoryCache.cs
@@ -59,7 +59,7 @@ static T[] ImmutableAdd<T>(T[] source, T item)
Array.Copy(source, copy, source.Length);
copy[source.Length] = item;
-
+
return copy;
}
@@ -87,7 +87,7 @@ public void Append(string streamName, byte[] data, long newStoreVersion, Action<
{
_thread.ExitWriteLock();
}
-
+
}
public IEnumerable<DataWithVersion> ReadRecords(string streamName, long afterVersion, int maxCount)
@@ -102,14 +102,14 @@ public IEnumerable<DataWithVersion> ReadRecords(string streamName, long afterVer
DataWithVersion[] list;
var result = _cacheByKey.TryGetValue(streamName, out list) ? list : Enumerable.Empty<DataWithVersion>();
- return result.Where(d => d.StoreVersion > afterVersion).Take(maxCount);
+ return result.Where(version => version.StoreVersion > afterVersion).Take(maxCount);
}
public IEnumerable<DataWithKey> ReadRecords(long afterVersion, int maxCount)
{
// collection is immutable so we don't care about locks
- return _cacheFull.Where(d => d.StoreVersion > afterVersion).Take(maxCount);
+ return _cacheFull.Where(key => key.StoreVersion > afterVersion).Take(maxCount);
}
public void Clear(Action onCommit)

0 comments on commit 3cc24ec

Please sign in to comment.
Something went wrong with that request. Please try again.