aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/Link/IntermediateTupleExtensions.cs
blob: c4c12e8143592a4ef60dc0d7808fb4f02b5a8ab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Core.Link
{
    using WixToolset.Data;

    internal static class IntermediateTupleExtensions
    {
        public static bool IsIdentical(this IntermediateTuple first, IntermediateTuple second)
        {
            var identical = (first.Definition.Type == second.Definition.Type && 
                             first.Definition.Name == second.Definition.Name && 
                             first.Definition.FieldDefinitions.Length == second.Definition.FieldDefinitions.Length);

            for (int i = 0; identical && i < first.Definition.FieldDefinitions.Length; ++i)
            {
                var firstField = first[i];
                var secondField = second[i];

                identical = (firstField.AsString() == secondField.AsString());
            }

            return identical;
        }
    }
}