title: Make HashSet<string> case-insensitive
body: <p>I have method with HashSet parameter. And I need to do case-insensitive Contains within it:</p>
  
  <pre><code>public void DoSomething(HashSet&lt;string&gt; set, string item)
  {
      var x = set.Contains(item);
      ... 
  }
  </code></pre>
  
  <p>Is it any way to make existing HashSet case-insensitive (do not create new one)?</p>
  
  <p>I'm looking for solution with best perfomance.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Contains can be called multiple times. So IEnumerable extensions are not acceptable for me due to lower perfomance than native HashSet Contains method.</p>
  
  <p><strong>Solution</strong></p>
  
  <p>Since, answer to my question is NO, it is impossible, I've created and used following method:</p>
  
  <pre><code>public HashSet&lt;string&gt; EnsureCaseInsensitive(HashSet&lt;string&gt; set)
  {
      return set.Comparer == StringComparer.OrdinalIgnoreCase
             ? set
             : new HashSet&lt;string&gt;(set, StringComparer.OrdinalIgnoreCase);
  }
  </code></pre>