Skip to content

Commit

Permalink
Minor performance optimization
Browse files Browse the repository at this point in the history
Summary: Avoid using `idx` in `PhutilTestCase::endCoverage`.

Test Plan: Compared [[https://secure.phabricator.com/xhprof/profile/PHID-FILE-tgmc6ci74daivtankuck/?symbol=idx | before]] and [[https://secure.phabricator.com/xhprof/profile/PHID-FILE-nd77mled6xnezyxidd6m/?symbol=idx | after]].

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13595
  • Loading branch information
joshuaspence committed Jul 8, 2015
1 parent 3d16595 commit 23a653e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/unit/engine/phutil/PhutilTestCase.php
Expand Up @@ -582,7 +582,10 @@ final private function endCoverage() {
$max = max(array_keys($report));
$str = '';
for ($ii = 1; $ii <= $max; $ii++) {
$c = idx($report, $ii);
$c = null;
if (isset($report[$ii])) {
$c = $report[$ii];
}
if ($c === -1) {
$str .= 'U'; // Un-covered.
} else if ($c === -2) {
Expand Down

0 comments on commit 23a653e

Please sign in to comment.