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
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,