Skip to content

Commit 2101478

Browse files
committed
Compare .Accessor indes instead of calculated accessors
1 parent c85fee9 commit 2101478

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Orm/Xtensive.Orm/Tuples/TupleExtensions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,16 +444,15 @@ private static void CopyPackedValue(PackedTuple source, int sourceIndex, PackedT
444444
return;
445445
}
446446

447-
var accessor = sourceDescriptor.GetAccessor();
448-
if (accessor != targetDescriptor.GetAccessor()) {
447+
if (sourceDescriptor.AccessorIndex != targetDescriptor.AccessorIndex) {
449448
throw new InvalidOperationException(string.Format(
450449
Strings.ExInvalidCast,
451450
source.PackedDescriptor[sourceIndex],
452451
target.PackedDescriptor[targetIndex]));
453452
}
454453

455454
target.SetFieldState(targetIndex, TupleFieldState.Available);
456-
accessor.CopyValue(source, sourceDescriptor, target, targetDescriptor);
455+
sourceDescriptor.GetAccessor().CopyValue(source, sourceDescriptor, target, targetDescriptor);
457456
}
458457

459458
private static void PartiallyCopyTupleSlow(Tuple source, Tuple target, int sourceStartIndex, int targetStartIndex, int length)

0 commit comments

Comments
 (0)