Skip to content

Commit

Permalink
chore: tidy codes
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <[email protected]>
  • Loading branch information
jfcherng committed Mar 4, 2024
1 parent e0da986 commit bf2ddb8
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/Differ.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ final class Differ

/**
* @var int the end index for the old if the old has no EOL at EOF
* -1 means the old has an EOL at EOF
* `-1` means the old has an EOL at EOF
*/
private int $oldNoEolAtEofIdx = -1;

/**
* @var int the end index for the new if the new has no EOL at EOF
* -1 means the new has an EOL at EOF
* `-1` means the new has an EOL at EOF
*/
private int $newNoEolAtEofIdx = -1;

/**
* @var int the result of comparing the old and the new with the spaceship operator
* -1 means old < new, 0 means old == new, 1 means old > new
* `-1` means `old < new`, `0` means `old == new`, `1` means `old > new`
*/
private int $oldNewComparison = 0;

Expand Down Expand Up @@ -310,12 +310,10 @@ public function getGroupedOpcodes(): array
return $this->groupedOpcodes;
}

$old = $this->old;
$new = $this->new;
$this->getGroupedOpcodesPre($old, $new);
$this->getGroupedOpcodesPre($this->old, $this->new);

$opcodes = $this->sequenceMatcher
->setSequences($old, $new)
->setSequences($this->old, $this->new)
->getGroupedOpcodes($this->options['context'])
;

Expand All @@ -337,12 +335,10 @@ public function getGroupedOpcodesGnu(): array
return $this->groupedOpcodesGnu;
}

$old = $this->old;
$new = $this->new;
$this->getGroupedOpcodesGnuPre($old, $new);
$this->getGroupedOpcodesGnuPre($this->old, $this->new);

$opcodes = $this->sequenceMatcher
->setSequences($old, $new)
->setSequences($this->old, $this->new)
->getGroupedOpcodes($this->options['context'])
;

Expand Down

0 comments on commit bf2ddb8

Please sign in to comment.