1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 00:32:41 +01:00

Minor performance optimization

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
This commit is contained in:
Joshua Spence 2015-07-08 18:32:08 +10:00
parent 3d16595c07
commit 23a653e2bb

View file

@ -582,7 +582,10 @@ abstract class PhutilTestCase extends Phobject {
$max = max(array_keys($report)); $max = max(array_keys($report));
$str = ''; $str = '';
for ($ii = 1; $ii <= $max; $ii++) { for ($ii = 1; $ii <= $max; $ii++) {
$c = idx($report, $ii); $c = null;
if (isset($report[$ii])) {
$c = $report[$ii];
}
if ($c === -1) { if ($c === -1) {
$str .= 'U'; // Un-covered. $str .= 'U'; // Un-covered.
} else if ($c === -2) { } else if ($c === -2) {