Browse files

Eliminate one foreach() loop.

  • Loading branch information...
1 parent d25b967 commit 52d2870e9578c0bc6a0aae25b564e17b38444685 @sebastianbergmann committed Sep 27, 2006
Showing with 12 additions and 13 deletions.
  1. +12 −13 PHPUnit/Util/Report/Coverage/Node/File.php
View
25 PHPUnit/Util/Report/Coverage/Node/File.php
@@ -137,19 +137,18 @@ public function setupCoveringTests(PHPUnit_Util_Report_Test_Node_TestSuite $test
$testCase = array();
$thisName = $this->getName(TRUE);
- foreach ($files as $file => $lines) {
- if ($thisName == $file) {
- foreach ($lines as $line => $tests) {
- if (is_array($tests)) {
- foreach ($tests as $test) {
- $testId = $test->__testNode->testId;
-
- if (!isset($testCase[$testId])) {
- $testCase[$testId] = array('numLinesExecuted' => 1, 'object' => $test);
- } else {
- $testCase[$testId]['numLinesExecuted']++;
- }
- }
+ foreach ($files[$thisName] as $line => $tests) {
+ if (is_array($tests)) {
+ foreach ($tests as $test) {
+ $testId = $test->__testNode->testId;
+
+ if (!isset($testCase[$testId])) {
+ $testCase[$testId] = array(
+ 'numLinesExecuted' => 1,
+ 'object' => $test
+ );
+ } else {
+ $testCase[$testId]['numLinesExecuted']++;
}
}
}

0 comments on commit 52d2870

Please sign in to comment.