Welcome to mirror list, hosted at ThFree Co, Russian Federation.

EcmaGenericParameter.Sorting.cs « Ecma « TypeSystem « Common « tools « coreclr « src - github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cc74c3ba5e6c459e4f7d3dc8f6f232d0dae53f13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Reflection.Metadata.Ecma335;

namespace Internal.TypeSystem.Ecma
{
    // Functionality related to deterministic ordering of types
    partial class EcmaGenericParameter
    {
        protected internal override int ClassCode => -1548417824;

        protected internal override int CompareToImpl(TypeDesc other, TypeSystemComparer comparer)
        {
            var otherType = (EcmaGenericParameter)other;
            int result = _module.MetadataReader.GetToken(_handle) - otherType._module.MetadataReader.GetToken(otherType._handle);
            if (result != 0)
                return result;

            return _module.CompareTo(otherType._module);
        }
    }
}