aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2016-02-22 12:01:39 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2016-02-22 12:01:39 +0100
commit4e49084e842b9afd61c0dbde857ff305fa46d9f8 (patch)
treea130664c5d93a240a2c242b70cce5491f608a31d
parent5c13cdb9abb5c5799fd2710b3e1f0505d72463d4 (diff)
downloadIterator-4e49084e842b9afd61c0dbde857ff305fa46d9f8.zip
Iterator-4e49084e842b9afd61c0dbde857ff305fa46d9f8.tar.gz
Iterator-4e49084e842b9afd61c0dbde857ff305fa46d9f8.tar.bz2
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.
-rw-r--r--Buffer.php8
1 files 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 @@ class Buffer
*/
public function current()
{
- $current = $this->getBuffer()->current();
-
- return $current[self::BUFFER_VALUE];
+ return $this->getBuffer()->current()[self::BUFFER_VALUE];
}
/**
@@ -150,9 +148,7 @@ class Buffer
*/
public function key()
{
- $current = $this->getBuffer()->current();
-
- return $current[self::BUFFER_KEY];
+ return $this->getBuffer()->current()[self::BUFFER_KEY];
}
/**