mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Level: Change isInWorld signature to use ints instead of floats
this is only used in one place, where it's being given floats, and it's 10% faster to use int for this because it won't convert it. It is also 25% faster to remove typehints and 60% faster to inline it. We really need a proper PHP preprocessor for inlining.
This commit is contained in:
@ -172,7 +172,7 @@ class SimpleChunkManager implements ChunkManager{
|
||||
return $this->worldHeight;
|
||||
}
|
||||
|
||||
public function isInWorld(float $x, float $y, float $z) : bool{
|
||||
public function isInWorld(int $x, int $y, int $z) : bool{
|
||||
return (
|
||||
$x <= INT32_MAX and $x >= INT32_MIN and
|
||||
$y < $this->worldHeight and $y >= 0 and
|
||||
|
Reference in New Issue
Block a user