Skip to content

Commit

Permalink
Merge pull request #4 from psibr/bugfix/v1.2.1
Browse files Browse the repository at this point in the history
- Bugfix/v1.2.1 
- Relates to PR #2
  • Loading branch information
Ovan Crone authored Mar 27, 2017
2 parents 157bc9a + 62069fb commit 435e46f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/Contextually.NET45/Contextually.NET45.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net45</TargetFramework>
<FileVersion>1.2.0.0</FileVersion>
<AssemblyVersion>1.2.0.0</AssemblyVersion>
<Version>1.2.0</Version>
<FileVersion>1.2.1.0</FileVersion>
<AssemblyVersion>1.2.1.0</AssemblyVersion>
<Version>1.2.1</Version>
<RootNamespace>Contextually</RootNamespace>
<Copyright>Psibernetic Solutions, LLC 2017</Copyright>
<AssemblyName>Contextually</AssemblyName>
Expand Down
6 changes: 3 additions & 3 deletions src/Contextually/Contextually.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<AssemblyVersion>1.2.0.0</AssemblyVersion>
<FileVersion>1.2.0.0</FileVersion>
<Version>1.2.0</Version>
<AssemblyVersion>1.2.1.0</AssemblyVersion>
<FileVersion>1.2.1.0</FileVersion>
<Version>1.2.1</Version>
<Company>Psibernetic Solutions, LLC</Company>
<Description />
<Authors>Ovan Crone, Andrea Balfour</Authors>
Expand Down
12 changes: 9 additions & 3 deletions src/Contextually/Relevant.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Collections.Concurrent;
using System.Threading;

namespace Contextually
Expand All @@ -12,7 +13,8 @@ public static class Relevant
{
private static RelevantInfoContainer RootContainer { get; } = new RelevantInfoContainer();

private static IDictionary<string, RelevantInfoContainer> NamedContainers { get; } = new Dictionary<string, RelevantInfoContainer>();
private static ConcurrentDictionary<string, RelevantInfoContainer> NamedContainers { get; }
= new ConcurrentDictionary<string, RelevantInfoContainer>();

/// <summary>
/// Retrieve the full set of values from all enclosing Info blocks.
Expand All @@ -27,7 +29,9 @@ public static NameValueCollection Info(string containerName = null)
if(!NamedContainers.TryGetValue(containerName, out var container))
{
container = new RelevantInfoContainer();
NamedContainers.Add(containerName, container);

if (!NamedContainers.TryAdd(containerName, container))
container = NamedContainers[containerName];
}

return container.Info();
Expand All @@ -48,7 +52,9 @@ public static IDisposable Info(NameValueCollection info, string containerName =
if(!NamedContainers.TryGetValue(containerName, out var container))
{
container = new RelevantInfoContainer();
NamedContainers.Add(containerName, container);

if (!NamedContainers.TryAdd(containerName, container))
container = NamedContainers[containerName];
}

return container.Info(info);
Expand Down

0 comments on commit 435e46f

Please sign in to comment.