Skip to content

Commit

Permalink
SNOW-990111: Refactor hash set to list
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-lf committed Jan 26, 2024
1 parent bb70c74 commit 9f2c874
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions Snowflake.Data/Configuration/EasyLoggingConfigParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,10 @@ private void Validate(ClientConfig config)
private void CheckForUnknownFields(string fileContent)
{
// Parse the specified config file and get the key-value pairs from the "common" section
HashSet<string> knownProperties = new HashSet<string>();
#if NET471
foreach (var property in typeof(ClientConfigCommonProps).GetProperties())
{
var jsonPropertyAttribute = property.GetCustomAttribute<JsonPropertyAttribute>();
knownProperties.Add(jsonPropertyAttribute.PropertyName);
}
#else
List<string> knownProperties = new List<string>();
knownProperties = typeof(ClientConfigCommonProps).GetProperties()
.Select(property => property.GetCustomAttribute<JsonPropertyAttribute>().PropertyName)
.ToHashSet();
#endif
.ToList();

JObject.Parse(fileContent).GetValue("common", StringComparison.OrdinalIgnoreCase)?
.Cast<JProperty>()
Expand Down

0 comments on commit 9f2c874

Please sign in to comment.