Lucene.Net.Search.FieldComparator.LongComparator.Compare C# (CSharp) Method

Compare() public method

public Compare ( int slot1, int slot2 ) : int
slot1 int
slot2 int
return int
			public override int Compare(int slot1, int slot2)
			{
				// TODO: there are sneaky non-branch ways to compute
				// -1/+1/0 sign
				long v1 = values[slot1];
				long v2 = values[slot2];
				if (v1 > v2)
				{
					return 1;
				}
				else if (v1 < v2)
				{
					return - 1;
				}
				else
				{
					return 0;
				}
			}