77using System ;
88using Xtensive . Core ;
99
10- using Xtensive . Tuples . Transform ;
11- using Xtensive . Collections ;
12-
1310namespace Xtensive . Orm . Rse . Providers
1411{
1512 /// <summary>
@@ -22,18 +19,12 @@ public class CalculateProvider : UnaryProvider,
2219 /// <summary>
2320 /// Gets a value indicating whether calculated columns should be inlined.
2421 /// </summary>
25- public bool IsInlined { get ; private set ; }
22+ public bool IsInlined { get ; }
2623
2724 /// <summary>
2825 /// Gets the calculated columns.
2926 /// </summary>
30- public CalculatedColumn [ ] CalculatedColumns { get ; private set ; }
31-
32- /// <summary>
33- /// Gets header resize transform.
34- /// </summary>
35- public MapTransform ResizeTransform { get ; private set ; }
36-
27+ public CalculatedColumn [ ] CalculatedColumns { get ; }
3728
3829 /// <inheritdoc/>
3930 protected override RecordSetHeader BuildHeader ( )
@@ -47,16 +38,6 @@ protected override string ParametersToString()
4738 return CalculatedColumns . ToCommaDelimitedString ( ) ;
4839 }
4940
50- /// <inheritdoc/>
51- protected override void Initialize ( )
52- {
53- base . Initialize ( ) ;
54- var columnIndexes = new int [ Header . Length ] ;
55- for ( int i = 0 ; i < columnIndexes . Length ; i ++ )
56- columnIndexes [ i ] = ( i < Source . Header . Length ) ? i : TransformUtil . NoMapping ;
57- ResizeTransform = new MapTransform ( false , Header . TupleDescriptor , columnIndexes ) ;
58- }
59-
6041
6142 // Constructors
6243
@@ -80,10 +61,10 @@ public CalculateProvider(CompilableProvider source, bool isInlined, params Calcu
8061 : base ( ProviderType . Calculate , source )
8162 {
8263 IsInlined = isInlined ;
64+ var sourceHeaderLength = Source . Header . Length ;
8365 var columns = new CalculatedColumn [ columnDescriptors . Length ] ;
8466 for ( int i = 0 ; i < columnDescriptors . Length ; i ++ ) {
85- var col = new CalculatedColumn ( columnDescriptors [ i ] , Source . Header . Length + i ) ;
86- columns . SetValue ( col , i ) ;
67+ columns [ i ] = new CalculatedColumn ( columnDescriptors [ i ] , sourceHeaderLength + i ) ;
8768 }
8869 CalculatedColumns = columns ;
8970 Initialize ( ) ;
0 commit comments