Skip to content

Commit dcc204f

Browse files
committed
No usage of DO ToHashSet usage in Tests.Core
1 parent de35641 commit dcc204f

2 files changed

Lines changed: 12 additions & 14 deletions

File tree

Orm/Xtensive.Orm.Tests.Core/Modelling/IndexingModel/PrimaryIndexInfo.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2009-2023 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Ivan Galkin
55
// Created: 2009.03.20
66

77
using System;
88
using System.Linq;
9-
using Xtensive.Core;
109
using Xtensive.Modelling;
1110
using Xtensive.Modelling.Attributes;
1211

@@ -31,7 +30,7 @@ public sealed class PrimaryIndexInfo : IndexInfo
3130
/// </summary>
3231
public void PopulateValueColumns()
3332
{
34-
var keySet = EnumerableExtensions.ToHashSet(KeyColumns.Select(kc => kc.Value));
33+
var keySet = KeyColumns.Select(kc => kc.Value).ToHashSet();
3534

3635
foreach (var column in Parent.Columns.Where(c => !keySet.Contains(c)))
3736
new ValueColumnRef(this, column);
@@ -41,7 +40,7 @@ public void PopulateValueColumns()
4140
/// <exception cref="ValidationException">Validation error.</exception>
4241
protected override void ValidateState()
4342
{
44-
using (var ea = new ExceptionAggregator()) {
43+
using (var ea = new Xtensive.Core.ExceptionAggregator()) {
4544
ea.Execute(base.ValidateState);
4645
base.ValidateState();
4746

@@ -63,7 +62,7 @@ protected override void ValidateState()
6362
ea.Execute(() => {
6463
throw new ValidationException(Strings.ExInvalidPrimaryKeyStructure, Path);
6564
});
66-
if (all.Zip(tableColumns).Where(p => p.First!=p.Second).Any())
65+
if (all.Zip(tableColumns, (first, second) => new {First = first, Second = second }).Where(p => p.First!=p.Second).Any())
6766
ea.Execute(() => {
6867
throw new ValidationException(Strings.ExInvalidPrimaryKeyStructure, Path);
6968
});

Orm/Xtensive.Orm.Tests.Core/Modelling/IndexingModel/SecondaryIndexInfo.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2009-2023 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Ivan Galkin
55
// Created: 2009.03.20
66

77
using System;
88
using System.Linq;
9-
using Xtensive.Core;
109
using Xtensive.Modelling;
1110
using Xtensive.Modelling.Attributes;
1211

@@ -44,7 +43,7 @@ public void PopulatePrimaryKeyColumns()
4443
/// <exception cref="ValidationException">Empty secondary key columns collection.</exception>
4544
protected override void ValidateState()
4645
{
47-
using (var ea = new ExceptionAggregator()) {
46+
using (var ea = new Xtensive.Core.ExceptionAggregator()) {
4847
ea.Execute(base.ValidateState);
4948

5049
// Secondary key columns: empty set, duplicates
@@ -77,9 +76,9 @@ protected override void ValidateState()
7776
}
7877

7978
// Included columns
80-
var fullKeySet = EnumerableExtensions.ToHashSet(KeyColumns
79+
var fullKeySet = KeyColumns
8180
.Select(cr => cr.Value)
82-
.Concat(PrimaryKeyColumns.Select(cr => cr.Value)));
81+
.Concat(PrimaryKeyColumns.Select(cr => cr.Value)).ToHashSet();
8382

8483
foreach (var columnRef in IncludedColumns) {
8584
if (fullKeySet.Contains(columnRef.Value))

0 commit comments

Comments
 (0)