Skip to content

Commit

Permalink
More curly braces and less HashSet.Contains invocations.
Browse files Browse the repository at this point in the history
  • Loading branch information
exyi committed Feb 6, 2018
1 parent 2ff5f26 commit 046bc0c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/MiniCover/Reports/HtmlReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,20 @@ protected override void WriteDetailedReport(InstrumentationResult result, IDicti
htmlWriter.WriteLine("<body style=\"font-family: sans-serif;\">");

var uncoveredLineNumbers = new HashSet<int>();
foreach(var i in kvFile.Value.Instructions)
if (!hits.Contains(i.Id))
for (var lineIndex = i.StartLine; lineIndex <= i.EndLine; lineIndex++)
uncoveredLineNumbers.Add(lineIndex);

var coveredLineNumbers = new HashSet<int>();
foreach (var i in kvFile.Value.Instructions)
foreach(var i in kvFile.Value.Instructions)
{
if (hits.Contains(i.Id))
{
for (var lineIndex = i.StartLine; lineIndex <= i.EndLine; lineIndex++)
coveredLineNumbers.Add(lineIndex);
}
else
{
for (var lineIndex = i.StartLine; lineIndex <= i.EndLine; lineIndex++)
uncoveredLineNumbers.Add(lineIndex);
}
}

var l = 0;
foreach (var line in lines)
Expand Down

0 comments on commit 046bc0c

Please sign in to comment.