Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Commit

Permalink
Buffer: Make current & key methods inlinable.
Browse files Browse the repository at this point in the history
By changing the code this way, the `current` and `key` methods are
inlinable by the VM if such heuristics exist.
  • Loading branch information
Hywan committed Feb 22, 2016
1 parent 5c13cdb commit 4e49084
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Buffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ public function getBufferSize()
*/
public function current()
{
$current = $this->getBuffer()->current();

return $current[self::BUFFER_VALUE];
return $this->getBuffer()->current()[self::BUFFER_VALUE];
}

/**
Expand All @@ -150,9 +148,7 @@ public function current()
*/
public function key()
{
$current = $this->getBuffer()->current();

return $current[self::BUFFER_KEY];
return $this->getBuffer()->current()[self::BUFFER_KEY];
}

/**
Expand Down

0 comments on commit 4e49084

Please sign in to comment.