callumbwhyte / super-value-converters

A collection of powerful property value converters for cleaner code in Umbraco
MIT License
14 stars 12 forks source link

Fix IntersectMany to actually compute the intersection #13

Closed rbottema closed 4 years ago

rbottema commented 4 years ago

In the current implementation, the return value of Intersect is not saved. As this is a 'pure method' that returns a new collection instead of modifying the original one, the calculation of the intersection is never saved. As a result, the returned 'intersection' is simply the list of the first value.

By saving the intersection result, this is resolved and from my quick tests, the returned intersection is correct.

This issue exists in both the v7 and v8 versions. This PR is for the v7 version as that is what I was working on when I found this out.

callumbwhyte commented 4 years ago

Hey @rbottema!

Thanks for contributing to SuperValueConverters!

This change looks great, something silly I overlooked clearly when writing this code! #H5YR

Callum