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:
parent
d6f4bded25
commit
9ddf37b9ee
1 changed files with 7 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue