From c1212eab8ec2a916f284fbda4e07f57c0c7f6a36 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 9 Jul 2019 13:38:26 +0100 Subject: [PATCH] EmptySubChunk: get rid of useless allocations --- src/pocketmine/world/format/EmptySubChunk.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pocketmine/world/format/EmptySubChunk.php b/src/pocketmine/world/format/EmptySubChunk.php index 7cc607e87..2d5962b2c 100644 --- a/src/pocketmine/world/format/EmptySubChunk.php +++ b/src/pocketmine/world/format/EmptySubChunk.php @@ -23,8 +23,6 @@ declare(strict_types=1); namespace pocketmine\world\format; -use function str_repeat; - class EmptySubChunk implements SubChunkInterface{ /** @var EmptySubChunk */ private static $instance; @@ -74,7 +72,7 @@ class EmptySubChunk implements SubChunkInterface{ } public function getBlockLightArray() : LightArray{ - return new LightArray(str_repeat("\x00", 2048)); + return new LightArray(LightArray::ZERO); } public function setBlockLightArray(LightArray $data) : void{ @@ -82,7 +80,7 @@ class EmptySubChunk implements SubChunkInterface{ } public function getBlockSkyLightArray() : LightArray{ - return new LightArray(str_repeat("\xff", 2048)); + return new LightArray(LightArray::FIFTEEN); } public function setBlockSkyLightArray(LightArray $data) : void{