Skip to content

Commit 2408a8a

Browse files
committed
Prevent sorting coverage-data over and over
1 parent 0373bbb commit 2408a8a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Node/Builder.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ private function buildDirectoryStructure(ProcessedCodeCoverageData $data): array
140140
{
141141
$result = [];
142142

143+
$lineCoverage = $data->lineCoverage();
144+
$functionCoverage = $data->functionCoverage();
143145
foreach ($data->coveredFiles() as $originalPath) {
144146
$path = explode(DIRECTORY_SEPARATOR, $originalPath);
145147
$pointer = &$result;
@@ -156,8 +158,8 @@ private function buildDirectoryStructure(ProcessedCodeCoverageData $data): array
156158
}
157159

158160
$pointer = [
159-
'lineCoverage' => $data->lineCoverage()[$originalPath] ?? [],
160-
'functionCoverage' => $data->functionCoverage()[$originalPath] ?? [],
161+
'lineCoverage' => $lineCoverage[$originalPath] ?? [],
162+
'functionCoverage' => $functionCoverage[$originalPath] ?? [],
161163
];
162164
}
163165

0 commit comments

Comments
 (0)