From 4e49084e842b9afd61c0dbde857ff305fa46d9f8 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Mon, 22 Feb 2016 12:01:39 +0100 Subject: [PATCH] Buffer: Make `current` & `key` methods inlinable. By changing the code this way, the `current` and `key` methods are inlinable by the VM if such heuristics exist. --- Buffer.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Buffer.php b/Buffer.php index d4a2c22..3a199da 100644 --- a/Buffer.php +++ b/Buffer.php @@ -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]; } /** @@ -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]; } /**