Skip to content

Commit e9b1f7d

Browse files
committed
Refactor TupleExtensions.CopyTo()
1 parent 74909d0 commit e9b1f7d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Orm/Xtensive.Orm/Tuples/TupleExtensions.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ public static class TupleExtensions
3535
/// <param name="length">The number of elements to copy.</param>
3636
public static void CopyTo(this Tuple source, Tuple target, int startIndex, int targetStartIndex, int length)
3737
{
38-
var packedSource = source as PackedTuple;
39-
var packedTarget = target as PackedTuple;
40-
41-
if (packedSource!=null && packedTarget!=null)
38+
if (source is PackedTuple packedSource && target is PackedTuple packedTarget) {
4239
PartiallyCopyTupleFast(packedSource, packedTarget, startIndex, targetStartIndex, length);
43-
else
40+
}
41+
else {
4442
PartiallyCopyTupleSlow(source, target, startIndex, targetStartIndex, length);
43+
}
4544
}
4645

4746
/// <summary>

0 commit comments

Comments
 (0)