@@ -248,10 +248,7 @@ protected override Expression VisitStructureFieldExpression(StructureFieldExpres
248
248
var mappingInfo = expression . Fields
249
249
. OfType < FieldExpression > ( )
250
250
. Where ( f => f . ExtendedType == ExtendedExpressionType . Field )
251
- . OrderBy ( f => f . Field . MappingInfo . Offset )
252
- . Select ( f => new Pair < ColNum > ( f . Field . MappingInfo . Offset , f . Mapping . Offset ) )
253
- . Distinct ( )
254
- . ToArray ( ) ;
251
+ . Select ( f => ( f . Field . MappingInfo . Offset , f . Mapping . Offset ) ) ;
255
252
256
253
var columnMap = MaterializationHelper . CreateSingleSourceMap ( tuplePrototype . Count , mappingInfo ) ;
257
254
@@ -296,11 +293,8 @@ protected override Expression VisitStructureExpression(StructureExpression expre
296
293
var tuplePrototype = typeInfo . TuplePrototype ;
297
294
var mappingInfo = expression . Fields
298
295
. OfType < FieldExpression > ( )
299
- . Where ( f => f . ExtendedType == ExtendedExpressionType . Field )
300
- . OrderBy ( f => f . Field . MappingInfo . Offset )
301
- . Select ( f => new Pair < ColNum > ( f . Field . MappingInfo . Offset , f . Mapping . Offset ) )
302
- . Distinct ( )
303
- . ToArray ( ) ;
296
+ . Where ( f => f . ExtendedType == ExtendedExpressionType . Field )
297
+ . Select ( f => ( f . Field . MappingInfo . Offset , f . Mapping . Offset ) ) ;
304
298
305
299
var columnMap = MaterializationHelper . CreateSingleSourceMap ( tuplePrototype . Count , mappingInfo ) ;
306
300
@@ -362,10 +356,8 @@ private Expression CreateEntity(IEntityExpression expression, Expression tupleEx
362
356
var mappingInfo = expression . Fields
363
357
. OfType < FieldExpression > ( )
364
358
. Where ( f => f . ExtendedType == ExtendedExpressionType . Field )
365
- . OrderBy ( f => f . Field . MappingInfo . Offset )
366
- . Select ( f => new Pair < ColNum > ( f . Field . MappingInfo . Offset , f . Mapping . Offset ) )
367
- . Distinct ( )
368
- . ToArray ( ) ;
359
+ . Select ( f => ( f . Field . MappingInfo . Offset , f . Mapping . Offset ) )
360
+ . ToHashSet ( ) ;
369
361
370
362
var isMaterializedExpression = Expression . Call (
371
363
itemMaterializationContextParameter ,
0 commit comments