Skip to content

Commit

Permalink
More cleaning.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCiliaVincenti committed Aug 10, 2024
1 parent 896f128 commit 1a00c51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 71 deletions.
59 changes: 0 additions & 59 deletions src/EasyCaching.Core/DistributedLock/RefCounter.cs

This file was deleted.

14 changes: 2 additions & 12 deletions src/EasyCaching.InMemory/Internal/InMemoryCaching.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,7 @@ private static bool FilterByPattern(string key, string searchKey, SearchKeyPatte

public IDictionary<string, CacheValue<T>> GetAll<T>(IEnumerable<string> keys)
{
var map = new Dictionary<string, CacheValue<T>>();
foreach (string key in keys)
map[key] = Get<T>(key);

return map;
return keys.ToDictionary(key => key, key => Get<T>(key));
}

public IDictionary<string, CacheValue<T>> GetAll<T>(string prefix = "")
Expand All @@ -323,13 +319,7 @@ public IDictionary<string, CacheValue<T>> GetAll<T>(string prefix = "")

public int SetAll<T>(IDictionary<string, T> values, TimeSpan? expiresIn = null)
{
if (values == null || values.Count == 0) return 0;

var list = new List<bool>();

foreach (var entry in values) list.Add(Set(entry.Key, entry.Value, expiresIn));

return list.Count(r => r);
return values?.Count(entry => Set(entry.Key, entry.Value, expiresIn)) ?? 0;
}

public bool Replace<T>(string key, T value, TimeSpan? expiresIn = null)
Expand Down

0 comments on commit 1a00c51

Please sign in to comment.