1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-02-16 16:58:38 +01:00

Improve performance of LINT_UNNECESSARY_SEMICOLON

Summary: Ref T7892. Improve the performance of `ArcanistXHPASTLinter::LINT_UNNECESSARY_SEMICOLON`.

Test Plan: Wiped 6 seconds off the total time to lint rARC.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7892

Differential Revision: https://secure.phabricator.com/D12519
This commit is contained in:
Joshua Spence 2015-04-23 20:15:00 +10:00
parent d6f4bded25
commit 9ddf37b9ee

View file

@ -3490,7 +3490,13 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
continue;
}
if ($statement->getSemanticString() == ';') {
if (count($statement->getChildren()) > 1) {
continue;
} else if ($statement->getChildByIndex(0)->getTypeName() != 'n_EMPTY') {
continue;
}
if ($statement->getConcreteString() == ';') {
$this->raiseLintAtNode(
$statement,
self::LINT_UNNECESSARY_SEMICOLON,