@@ -17,7 +17,7 @@ namespace Xtensive.Tuples.Transform
1717 [ Serializable ]
1818 public sealed class ConcatTransform
1919 {
20- private readonly ( TupleDescriptor first , TupleDescriptor second ) sources ;
20+ private readonly ( int first , int second ) sourceParts ;
2121
2222 /// <inheritdoc/>
2323 public TupleDescriptor Descriptor { get ; }
@@ -54,7 +54,23 @@ Tuple CopySourceTuples(Tuple source1, Tuple source2) {
5454 /// <inheritdoc/>
5555 public override string ToString ( )
5656 {
57- var description = $ "{ sources . first } + { sources . second } , { ( IsReadOnly ? Strings . ReadOnlyShort : Strings . ReadWriteShort ) } ";
57+ var sb = new ValueStringBuilder ( stackalloc char [ 4096 ] ) ;
58+ for ( int i = 0 , count = sourceParts . first ; i < count ; i ++ ) {
59+ if ( i > 0 )
60+ sb . Append ( ", " ) ;
61+ sb . Append ( Descriptor [ i ] . GetShortName ( ) ) ;
62+ }
63+ var sourceOne = string . Format ( Strings . TupleDescriptorFormat , sb . ToString ( ) ) ;
64+
65+ sb = new ValueStringBuilder ( stackalloc char [ 4096 ] ) ;
66+ for ( int i = sourceParts . first , count = Descriptor . Count ; i < count ; i ++ ) {
67+ if ( i > sourceParts . first )
68+ sb . Append ( ", " ) ;
69+ sb . Append ( Descriptor [ i ] . GetShortName ( ) ) ;
70+ }
71+ var sourceTwo = string . Format ( Strings . TupleDescriptorFormat , sb . ToString ( ) ) ;
72+
73+ var description = $ "{ sourceOne } + { sourceTwo } , { ( IsReadOnly ? Strings . ReadOnlyShort : Strings . ReadWriteShort ) } ";
5874 return string . Format ( Strings . TupleTransformFormat ,
5975 nameof ( ConcatTransform ) ,
6076 description ) ;
@@ -76,7 +92,7 @@ public ConcatTransform(bool isReadOnly, TupleDescriptor first, TupleDescriptor s
7692
7793 IsReadOnly = isReadOnly ;
7894 Descriptor = first . ConcatWith ( second ) ;
79- this . sources = ( first , second ) ;
95+ this . sourceParts = ( first . Count , second . Count ) ;
8096 }
8197 }
8298}
0 commit comments