Skip to content

Commit

Permalink
Review: No need to create a ReadOnlyDictionary after .ToDictionary()
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibaud DESODT authored and tsimbalar committed Nov 8, 2017
1 parent 670a5ff commit 1c3449c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Serilog/Configuration/LoggerSettingsConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public LoggerConfiguration KeyValuePairs(IEnumerable<KeyValuePair<string, string
{
if (settings == null) throw new ArgumentNullException(nameof(settings));

var settingsDictionary = new ReadOnlyDictionary<string, string>(settings.ToDictionary(x => x.Key, x => x.Value));
return Settings(new KeyValuePairSettings(settingsDictionary));
return Settings(new KeyValuePairSettings(settings.ToDictionary(x => x.Key, x => x.Value)));
}
}
}

0 comments on commit 1c3449c

Please sign in to comment.