EmptySubChunk: get rid of useless allocations

This commit is contained in:
Dylan K. Taylor 2019-07-09 13:38:26 +01:00
parent bda9bd2f2d
commit c1212eab8e

View File

@ -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{