mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
Stop cloning Color objects
since these are now immutable, there's no need to clone them.
This commit is contained in:
parent
f356bf0893
commit
77919b70b2
@ -279,7 +279,7 @@ class Effect{
|
|||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
public function getColor() : Color{
|
public function getColor() : Color{
|
||||||
return clone $this->color;
|
return $this->color;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -350,8 +350,4 @@ class Effect{
|
|||||||
public function remove(Living $entity, EffectInstance $instance) : void{
|
public function remove(Living $entity, EffectInstance $instance) : void{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __clone(){
|
|
||||||
$this->color = clone $this->color;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ class EffectInstance{
|
|||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
public function getColor() : Color{
|
public function getColor() : Color{
|
||||||
return clone $this->color;
|
return $this->color;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -209,7 +209,7 @@ class EffectInstance{
|
|||||||
* @return EffectInstance
|
* @return EffectInstance
|
||||||
*/
|
*/
|
||||||
public function setColor(Color $color) : EffectInstance{
|
public function setColor(Color $color) : EffectInstance{
|
||||||
$this->color = clone $color;
|
$this->color = $color;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user