I wrote a test program to try it out. It looks like it actually does Compare() the same element to itself (at least Compare() is called for the same item twice). In this program, Compare() is called with arguments (2, 2).
using System;
using System.Collections.Generic;
static class Program
{
class MyComparer : Comparer<int>
{
public override int Compare(int x, int y)
{
Console.WriteLine("Compare(" + x + ", " + y + ")");
if (x < y) return -1;
if (x > y) return 1;
return 0;
}
}
static void Main()
{
MyComparer comparer = new MyComparer();
List<int> list = new List<int> { 1, 2, 3 };
list.Sort(comparer);
return;
}
}
And the output is:
Compare(1, 2)
Compare(1, 3)
Compare(2, 3)
Compare(1, 2)
Compare(2, 2)
Compare(2, 3)
Compare(2, 2)