Skip to content

Commit 6321d2c

Browse files
committed
IndexBuilder.SingleTable: Remove .ToList(), no need for enumeration
Even in case when we need to copy refs to some collection we don't need it, Reverse() copies refs to a buffer collection anyway.
1 parent 30441d6 commit 6321d2c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Orm/Xtensive.Orm/Orm/Building/Builders/IndexBuilder.SingleTable.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,14 @@ private void BuildSingleTableIndexes(TypeInfo type)
7979
if (!type.IsAbstract)
8080
primaryIndexFilterTypes.Add(type);
8181
primaryIndexFilterTypes.AddRange(descendants);
82-
82+
8383
// Import inherited indexes
8484
var ancestorIndexes = root.Indexes
8585
.Where(i => types.Contains(i.ReflectedType) && !i.IsTyped)
8686
.Reverse()
8787
.Select(i => untypedIndexes.Contains(i)
8888
? root.Indexes.Single(index => index.DeclaringIndex == i.DeclaringIndex && index.ReflectedType == type && index.IsTyped)
89-
: i)
90-
.ToList();
89+
: i);
9190
foreach (var ancestorIndex in ancestorIndexes) {
9291
if (type.Indexes.Any(i =>
9392
i.DeclaringIndex == ancestorIndex.DeclaringIndex &&

0 commit comments

Comments
 (0)