1- // Copyright (C) 2003-2010 Xtensive LLC.
2- // All rights reserved .
3- // For conditions of distribution and use, see license .
1+ // Copyright (C) 2003-2021 Xtensive LLC.
2+ // This code is distributed under MIT license terms .
3+ // See the License.txt file in the project root for more information .
44// Created by: Alexander Nikolaev
55// Created: 2009.07.13
66
77using System ;
8+ using System . Collections . Generic ;
89using JetBrains . Annotations ;
910using Xtensive . Core ;
1011using Xtensive . Orm . Model ;
@@ -16,13 +17,13 @@ namespace Xtensive.Orm.Internals
1617 [ Serializable ]
1718 internal sealed class Key < T1 , T2 , T3 , T4 > : Key
1819 {
19- private static readonly Predicate < T1 , T1 > equalityComparer1 =
20+ private static readonly Predicate < T1 , T1 > EqualityComparer1 =
2021 ComparerProvider . Default . GetComparer < T1 > ( ) . Equals ;
21- private static readonly Predicate < T2 , T2 > equalityComparer2 =
22+ private static readonly Predicate < T2 , T2 > EqualityComparer2 =
2223 ComparerProvider . Default . GetComparer < T2 > ( ) . Equals ;
23- private static readonly Predicate < T3 , T3 > equalityComparer3 =
24+ private static readonly Predicate < T3 , T3 > EqualityComparer3 =
2425 ComparerProvider . Default . GetComparer < T3 > ( ) . Equals ;
25- private static readonly Predicate < T4 , T4 > equalityComparer4 =
26+ private static readonly Predicate < T4 , T4 > EqualityComparer4 =
2627 ComparerProvider . Default . GetComparer < T4 > ( ) . Equals ;
2728
2829 private readonly T1 value1 ;
@@ -46,10 +47,10 @@ protected override bool ValueEquals(Key other)
4647 if ( otherKey == null )
4748 return false ;
4849 return
49- equalityComparer4 . Invoke ( value4 , otherKey . value4 ) &&
50- equalityComparer3 . Invoke ( value3 , otherKey . value3 ) &&
51- equalityComparer2 . Invoke ( value2 , otherKey . value2 ) &&
52- equalityComparer1 . Invoke ( value1 , otherKey . value1 ) ;
50+ EqualityComparer4 . Invoke ( value4 , otherKey . value4 ) &&
51+ EqualityComparer3 . Invoke ( value3 , otherKey . value3 ) &&
52+ EqualityComparer2 . Invoke ( value2 , otherKey . value2 ) &&
53+ EqualityComparer1 . Invoke ( value1 , otherKey . value1 ) ;
5354 }
5455
5556 protected override int CalculateHashCode ( )
@@ -62,7 +63,7 @@ protected override int CalculateHashCode()
6263 }
6364
6465 [ UsedImplicitly ]
65- public static Key Create ( string nodeId , TypeInfo type , Tuple tuple , TypeReferenceAccuracy accuracy , int [ ] keyIndexes )
66+ public static Key Create ( string nodeId , TypeInfo type , Tuple tuple , TypeReferenceAccuracy accuracy , IReadOnlyList < int > keyIndexes )
6667 {
6768 return new Key < T1 , T2 , T3 , T4 > ( nodeId , type , accuracy ,
6869 tuple . GetValueOrDefault < T1 > ( keyIndexes [ 0 ] ) ,
@@ -81,7 +82,7 @@ public static Key Create(string nodeId, TypeInfo type, Tuple tuple, TypeReferenc
8182 tuple . GetValueOrDefault < T4 > ( 3 ) ) ;
8283 }
8384
84-
85+
8586 // Constructors
8687
8788 private Key ( string nodeId , TypeInfo type , TypeReferenceAccuracy accuracy , T1 value1 , T2 value2 , T3 value3 , T4 value4 )
0 commit comments