mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
avoid type juggling in conditions, always use explicit boolean conditions
This commit is contained in:
@ -144,7 +144,7 @@ class CraftingManager{
|
||||
*/
|
||||
public static function sort(Item $i1, Item $i2){
|
||||
//Use spaceship operator to compare each property, then try the next one if they are equivalent.
|
||||
($retval = $i1->getId() <=> $i2->getId()) === 0 && ($retval = $i1->getDamage() <=> $i2->getDamage()) === 0 && ($retval = $i1->getCount() <=> $i2->getCount());
|
||||
($retval = $i1->getId() <=> $i2->getId()) === 0 && ($retval = $i1->getDamage() <=> $i2->getDamage()) === 0 && ($retval = $i1->getCount() <=> $i2->getCount()) === 0;
|
||||
|
||||
return $retval;
|
||||
}
|
||||
|
Reference in New Issue
Block a user