mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-31 23:33:06 +00:00
Remove double use of spl_object_hash (#2226)
This commit is contained in:
parent
37b445f210
commit
aeb551b317
@ -82,7 +82,7 @@ class InventoryTransaction{
|
|||||||
*/
|
*/
|
||||||
public function addAction(InventoryAction $action) : void{
|
public function addAction(InventoryAction $action) : void{
|
||||||
if(!isset($this->actions[$hash = spl_object_hash($action)])){
|
if(!isset($this->actions[$hash = spl_object_hash($action)])){
|
||||||
$this->actions[spl_object_hash($action)] = $action;
|
$this->actions[$hash] = $action;
|
||||||
$action->onAddToTransaction($this);
|
$action->onAddToTransaction($this);
|
||||||
}else{
|
}else{
|
||||||
throw new \InvalidArgumentException("Tried to add the same action to a transaction twice");
|
throw new \InvalidArgumentException("Tried to add the same action to a transaction twice");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user