Skip to content

Conversation

@emadb
Copy link

@emadb emadb commented Jul 23, 2014

I'm not sure that this solution works, but the test is green ;-)

@arialdomartini arialdomartini changed the title My attempt to remove the two if Solution # 2 - My attempt to remove the two if Jul 23, 2014
@arialdomartini
Copy link
Contributor

Amazing! Thank, Ema.
As a matter of fact, two of us think that initializing the collections in the constructor is a good idea. I still wonder why @ayende made a different choose.

Comparing @emadb solution with @matteobaglini's one I noticed that the extension method

 public static class Extensions
 {
     public static HashSet<T> ToHashSet<T>(this IEnumerable<T> source)
     {
          return new HashSet<T>(source);
     }
}

could be easily replaced with a simpler

new HashSet<string>(_ensuredFieldNames);

I think it's slightly less invasive, and I tend to prefer @emadb's approach, so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants