Remove redundant checks

This commit is contained in:
Timothy Warren 2019-11-18 13:45:36 -05:00
parent cf75f92cd5
commit 0ed7a34948

View File

@ -82,10 +82,7 @@ class PHP {
[$type, $rawChar, $currentLine] = $token; [$type, $rawChar, $currentLine] = $token;
$char = tabs_to_spaces($rawChar); $char = tabs_to_spaces($rawChar);
if ($currentLine !== $this->lineNum)
{
$this->lineNum = $currentLine; $this->lineNum = $currentLine;
}
$current = [ $current = [
'type' => $type, 'type' => $type,
@ -100,11 +97,6 @@ class PHP {
$this->tokens[$this->lineNum][] = $current; $this->tokens[$this->lineNum][] = $current;
$this->lineNum++; $this->lineNum++;
if ( ! array_key_exists($this->lineNum, $this->tokens))
{
$this->tokens[$this->lineNum] = [];
}
return; return;
} }
@ -124,11 +116,6 @@ class PHP {
{ {
$nextLine++; $nextLine++;
if ( ! array_key_exists($nextLine, $this->tokens))
{
$tokens[$nextLine] = [];
}
if ( ! empty($char)) if ( ! empty($char))
{ {
$this->processStringToken($char, $nextLine); $this->processStringToken($char, $nextLine);