<commit_before>using System.Collections.Generic;
using System.Collections.Immutable;

namespace Vostok.Flow
{
    internal class ContextConfiguration : IContextConfiguration
    {
        private ImmutableHashSet<string> distributedProperties = ImmutableHashSet<string>.Empty;
        private readonly object syncObject = new object();

        public bool IsDistributedProperty(string key)
        {
            return distributedProperties.Contains(key);
        }

        public void AddDistributedProperty(string key)
        {
            lock (syncObject)
            {
                distributedProperties = distributedProperties.Add(key);
            }
        }
    }
}<commit_msg>ContextConfiguration: got rid of ImmutableHashSet.<commit_after>using System.Collections.Generic;
using System.Threading;

namespace Vostok.Flow
{
    internal class ContextConfiguration : IContextConfiguration
    {
        private readonly object syncObject = new object();
        private HashSet<string> distributedProperties = new HashSet<string>();

        public bool IsDistributedProperty(string key)
        {
            return distributedProperties.Contains(key);
        }

        public void AddDistributedProperty(string key)
        {
            lock (syncObject)
            {
                if (distributedProperties.Contains(key))
                    return;

                var newProperties = new HashSet<string>(distributedProperties)
                {
                    key
                };

                Interlocked.Exchange(ref distributedProperties, newProperties);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.06765067650676507, 'fraction_numerical': 0.0, 'mean_word_length': 2.1348747591522157, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6257706', 'n_tokens_mistral': 372, 'n_tokens_neox': 354, 'n_words': 82}