style: refactoring based on Rider suggestions
This commit is contained in:
@@ -2,16 +2,8 @@ namespace RedNosedReports;
|
||||
|
||||
class PuzzleParser
|
||||
{
|
||||
public List<Report> Parse(string[] lines)
|
||||
{
|
||||
var reports = new List<Report>();
|
||||
|
||||
foreach (var line in lines)
|
||||
{
|
||||
var numbers = line.Split(' ').Select(int.Parse).ToList();
|
||||
reports.Add(new Report(numbers));
|
||||
}
|
||||
|
||||
return reports;
|
||||
}
|
||||
public List<Report> Parse(string[] lines) => lines
|
||||
.Select(line => line.Split(' ').Select(int.Parse).ToList())
|
||||
.Select(numbers => new Report(numbers))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user