3 // Copyright (c) Microsoft Corporation. All rights reserved.
6 // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
10 // <OWNER>Microsoft</OWNER>
12 // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
14 using System.Collections.Generic;
16 namespace System.Linq.Parallel
19 /// PairComparer compares pairs by the first element, and breaks ties by the second
22 /// <typeparam name="T"></typeparam>
23 /// <typeparam name="U"></typeparam>
24 internal class PairComparer<T, U> : IComparer<Pair<T, U>>
26 private IComparer<T> m_comparer1;
27 private IComparer<U> m_comparer2;
29 public PairComparer(IComparer<T> comparer1, IComparer<U> comparer2)
31 m_comparer1 = comparer1;
32 m_comparer2 = comparer2;
35 public int Compare(Pair<T, U> x, Pair<T, U> y)
37 int result1 = m_comparer1.Compare(x.First, y.First);
43 return m_comparer2.Compare(x.Second, y.Second);