Skip to content

Commit 580ef00

Browse files
author
Mads Dabros
committed
refactor
1 parent 1f98d65 commit 580ef00

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/SharpLearning.Benchmarks/Benchmarks.ClassificationLearners.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System.Linq;
23
using BenchmarkDotNet.Attributes;
34
using SharpLearning.AdaBoost.Learners;
45
using SharpLearning.Common.Interfaces;
@@ -50,9 +51,7 @@ public void Learn(string learnerName)
5051
learner.Learn(m_features, m_targets);
5152
}
5253

53-
public IEnumerable<string> GetLearners()
54-
{
55-
return m_learners.Keys;
56-
}
54+
public IReadOnlyList<string> GetLearners() =>
55+
m_learners.Keys.ToArray();
5756
}
5857
}

src/SharpLearning.Benchmarks/Benchmarks.RegressionLearners.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System.Linq;
23
using BenchmarkDotNet.Attributes;
34
using SharpLearning.AdaBoost.Learners;
45
using SharpLearning.Common.Interfaces;
@@ -50,9 +51,7 @@ public void Learn(string learnerName)
5051
learner.Learn(m_features, m_targets);
5152
}
5253

53-
public IEnumerable<string> GetLearners()
54-
{
55-
return m_learners.Keys;
56-
}
54+
public IReadOnlyList<string> GetLearners() =>
55+
m_learners.Keys.ToArray();
5756
}
5857
}

0 commit comments

Comments
 (0)