Skip to content

Commit

Permalink
styles: format code #497
Browse files Browse the repository at this point in the history
  • Loading branch information
Memoyu committed Oct 12, 2023
1 parent c87b059 commit 9ece7ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/EasyCaching.InMemory/Internal/InMemoryCaching.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public int RemoveByPattern(string searchKey, SearchKeyPattern searchPattern)
public IEnumerable<string> GetAllKeys(string prefix)
{
return _memory.Values.Where(x => x.Key.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) && x.ExpiresAt > SystemClock.UtcNow)
.Select(x=> x.Key).ToList();
.Select(x => x.Key).ToList();
}

private static bool FilterByPattern(string key, string searchKey, SearchKeyPattern searchKeyPattern)
Expand Down Expand Up @@ -314,10 +314,10 @@ public IDictionary<string, CacheValue<T>> GetAll<T>(IEnumerable<string> keys)

public IDictionary<string, CacheValue<T>> GetAll<T>(string prefix = "")
{
var values = string.IsNullOrEmpty(prefix)
? _memory.Values.Where(x => x.ExpiresAt > SystemClock.UtcNow)
var values = string.IsNullOrEmpty(prefix)
? _memory.Values.Where(x => x.ExpiresAt > SystemClock.UtcNow)
: _memory.Values.Where(x => x.Key.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) && x.ExpiresAt > SystemClock.UtcNow);

return values.ToDictionary(k => k.Key, v => new CacheValue<T>(v.GetValue<T>(_options.EnableReadDeepClone), true));
}

Expand Down

0 comments on commit 9ece7ff

Please sign in to comment.