mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 08:49:42 +00:00
LightArray: make collectGarbage() more preload-friendly
opcache preloading doesn't store non-class constants, but it does store class constants. Class constants that reference non-class constants are pre-resolved into values before storing in opcache SHM, so class constants are OK to use, but non-class constants will come back as undefined.
This commit is contained in:
parent
b81cc671e9
commit
a68b0b1f93
@ -82,10 +82,10 @@ final class LightArray{
|
|||||||
* reference to the const instead of duplicating the whole string. The string will only be duplicated when
|
* reference to the const instead of duplicating the whole string. The string will only be duplicated when
|
||||||
* modified, which is perfect for this purpose.
|
* modified, which is perfect for this purpose.
|
||||||
*/
|
*/
|
||||||
if($this->data === ZERO_NIBBLE_ARRAY){
|
if($this->data === self::ZERO){
|
||||||
$this->data = ZERO_NIBBLE_ARRAY;
|
$this->data = self::ZERO;
|
||||||
}elseif($this->data === FIFTEEN_NIBBLE_ARRAY){
|
}elseif($this->data === self::FIFTEEN){
|
||||||
$this->data = FIFTEEN_NIBBLE_ARRAY;
|
$this->data = self::FIFTEEN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user