← All changes
|
modules/tiled-gallery/math/class-constrained-array-rounding.php
+2
-8
12.7.3
→
16.3-a.1
View file →
| @@ -90,12 +90,9 @@ | ||
| 90 | 90 | * |
| 91 | 91 | * @return int |
| 92 | 92 | */ |
| 93 | 93 | private static function cmp_desc_fraction( $a, $b ) { |
| 94 | - if ( $a['fraction'] === $b['fraction'] ) { | |
| 95 | - return 0; | |
| 96 | - } | |
| 97 | - return $a['fraction'] > $b['fraction'] ? -1 : 1; | |
| 94 | + return $b['fraction'] <=> $a['fraction']; | |
| 98 | 95 | } |
| 99 | 96 | |
| 100 | 97 | /** |
| 101 | 98 | * Compare index values of two arrays. |
| @@ -105,10 +102,7 @@ | ||
| 105 | 102 | * |
| 106 | 103 | * @return int |
| 107 | 104 | */ |
| 108 | 105 | private static function cmp_asc_index( $a, $b ) { |
| 109 | - if ( $a['index'] === $b['index'] ) { | |
| 110 | - return 0; | |
| 111 | - } | |
| 112 | - return $a['index'] < $b['index'] ? -1 : 1; | |
| 106 | + return $a['index'] <=> $b['index']; | |
| 113 | 107 | } |
| 114 | 108 | } |