Skip to content

Commit

Permalink
Revert "Make OutputPattern Replacements thread safe."
Browse files Browse the repository at this point in the history
This reverts commit ac80117.
  • Loading branch information
Piotrekol committed Mar 30, 2018
1 parent f46ddb9 commit 8710a0a
Showing 1 changed file with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,7 @@ public class OutputPattern : EventArgs, INotifyPropertyChanged, ICloneable
private OsuStatus _saveEvent;
private string _pattern;
private string _name;
private Dictionary<string, string> _replacements;
[Browsable(false)]
public Dictionary<string, string> Replacements
{
get => _replacements;
set
{
lock (_lockingObject) _replacements = value;
}
}
private readonly object _lockingObject = new Object();
public Dictionary<string, string> Replacements;
[DisplayName("Name")]
public string Name
{
Expand Down Expand Up @@ -105,15 +95,12 @@ public string GetFormatedPattern()
{
if (Replacements != null)
{
lock (_lockingObject)
string toFormat = this.Pattern ?? "";
foreach (var r in Replacements)
{
string toFormat = this.Pattern ?? "";
foreach (var r in Replacements)
{
toFormat = toFormat.Replace(r.Key, r.Value, StringComparison.InvariantCultureIgnoreCase);
}
return toFormat;
toFormat = toFormat.Replace(r.Key, r.Value, StringComparison.InvariantCultureIgnoreCase);
}
return toFormat;
}
return string.Empty;
}
Expand Down

0 comments on commit 8710a0a

Please sign in to comment.