Skip to content

Commit 99e2a71

Browse files
authored
Make RecordSetHeader.ColumnGroups array instead of List<> (#364)
1 parent ea9c6bd commit 99e2a71

File tree

2 files changed

+14
-46
lines changed

2 files changed

+14
-46
lines changed

Orm/Xtensive.Orm/Orm/Model/ColumnGroup.cs

+13-45
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,19 @@
44
// Created by: Alexey Kochetov
55
// Created: 2008.08.01
66

7-
using System;
8-
using System.Collections.Generic;
97
using System.Diagnostics;
108
using Xtensive.Collections;
119

12-
13-
namespace Xtensive.Orm.Model
14-
{
15-
/// <summary>
16-
/// Describes a group of columns that belongs to the specified <see cref="TypeInfoRef"/>.
17-
/// </summary>
18-
[Serializable]
19-
[DebuggerDisplay("Type = {TypeInfoRef}, Keys = {Keys}, Columns = {Columns}")]
20-
public readonly struct ColumnGroup
21-
{
22-
/// <summary>
23-
/// Gets the <see cref="Model.TypeInfoRef"/> pointing to <see cref="TypeInfo"/>
24-
/// this column group belongs to.
25-
/// </summary>
26-
public TypeInfoRef TypeInfoRef { get; }
27-
28-
/// <summary>
29-
/// Gets the indexes of key columns.
30-
/// </summary>
31-
public IReadOnlyList<ColNum> Keys { get; }
32-
33-
/// <summary>
34-
/// Gets the indexes of all columns.
35-
/// </summary>
36-
public IReadOnlyList<ColNum> Columns { get; }
37-
38-
39-
// Constructors
40-
41-
/// <summary>
42-
/// Initializes a new instance of this class.
43-
/// </summary>
44-
/// <param name="type">The type.</param>
45-
/// <param name="keys">The keys.</param>
46-
/// <param name="columns">The columns.</param>
47-
public ColumnGroup(TypeInfoRef type, IReadOnlyList<ColNum> keys, IReadOnlyList<ColNum> columns)
48-
{
49-
TypeInfoRef = type;
50-
Keys = keys;
51-
Columns = columns;
52-
}
53-
}
54-
}
10+
namespace Xtensive.Orm.Model;
11+
12+
/// <summary>
13+
/// Describes a group of columns that belongs to the specified <see cref="TypeInfoRef"/>.
14+
/// </summary>
15+
[Serializable]
16+
[DebuggerDisplay("Type = {TypeInfoRef}, Keys = {Keys}, Columns = {Columns}")]
17+
public record struct ColumnGroup
18+
(
19+
TypeInfoRef TypeInfoRef,
20+
IReadOnlyList<ColNum> Keys, // indexes of key columns.
21+
IReadOnlyList<ColNum> Columns // indexes of all columns.
22+
);

Orm/Xtensive.Orm/Orm/Rse/RecordSetHeader.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public RecordSetHeader Select(IReadOnlyList<ColNum> columns)
188188
return new RecordSetHeader(
189189
TupleDescriptor.CreateFromNormalized(columns.Select(i => TupleDescriptor[i]).ToArray(columns.Count)),
190190
columns.Select((oldIndex, newIndex) => Columns[oldIndex].Clone((ColNum) newIndex)).ToArray(columns.Count),
191-
resultGroups.ToList(),
191+
resultGroups.ToArray(),
192192
null,
193193
resultOrder);
194194
}

0 commit comments

Comments
 (0)