Skip to content

Commit

Permalink
Rewrite test code.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanLarsson committed Nov 4, 2018
1 parent 8820ebe commit 28a31cf
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ namespace RoslynSandbox
public static class Foo
{
private static readonly ConcurrentDictionary<int, Stream> Cache = new ConcurrentDictionary<int, Stream>();
private static readonly ConcurrentDictionary<string, Stream> Cache = new ConcurrentDictionary<string, Stream>();
public static long Bar()
public static long Bar(string fileName)
{
var stream = Cache.GetOrAdd(1, _ => File.OpenRead(string.Empty));
var stream = Cache.GetOrAdd(fileName, x => File.OpenRead(x));
return stream.Length;
}
}
Expand Down

0 comments on commit 28a31cf

Please sign in to comment.