LINQ List comparing question

I have two list comparing to one another. Works great but, the Items in each list compare TWICE.

Example:

Item No. 1Item No. 2Item No. 3

Comparisons loop: 1<>2, 1<>3, 2<>3

At this point it can stop, however, it feels it hasn’t compared the items in each list yet so it then does this:

2<>1, 3<>1, 3<>2

So you can see it swaps and compares again. Not a huge deal, but i’m curious how to prevent it from comparing again.

Link to code here: https://pastebin.com/jifcQ2rg

submitted by /u/Effimero89
[link] [comments]

Leave a Reply