Use spaceship operator for comparison
authorJoshua Rüsweg <josh@bastelstu.be>
Sun, 25 Nov 2018 21:18:01 +0000 (22:18 +0100)
committerJoshua Rüsweg <josh@bastelstu.be>
Sun, 25 Nov 2018 21:18:01 +0000 (22:18 +0100)
See #2716

wcfsetup/install/files/lib/system/worker/UserContentRemoveWorker.class.php

index f94119ff543224537339847f152932c2954e52e7..983f916b64cc95691304649b412c356dbe657bd5 100644 (file)
@@ -150,14 +150,7 @@ class UserContentRemoveWorker extends AbstractWorker implements IWorker {
                        $niceValueA = ($a['nicevalue'] ?: 0);
                        $niceValueB = ($b['nicevalue'] ?: 0);
                        
-                       if ($niceValueA < $niceValueB) {
-                               return -1;
-                       }
-                       else if ($niceValueA > $niceValueB) {
-                               return 1;
-                       }
-                       
-                       return 0;
+                       return $niceValueA <=> $niceValueB;
                });
        }