Skip to content

Commit

Permalink
Move method call out of hot loop (#1413)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored May 19, 2023
1 parent aa6637b commit abe4a82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Analyzer/RstAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ public function analyze(\SplFileInfo $file, array $rules): array
*/
foreach ($lines->toIterator() as $no => $line) {
\assert(\is_int($no));
$lineIsBlank = $line->isBlank();

foreach ($lineContentRules as $rule) {
if ($lines->isProcessedBy($no, $rule::class)) {
continue;
}

if (!$rule::runOnlyOnBlankline() && $line->isBlank()) {
if (!$rule::runOnlyOnBlankline() && $lineIsBlank) {
continue;
}

Expand Down

0 comments on commit abe4a82

Please sign in to comment.