diff options
author | Lukas Winkler <git@lw1.at> | 2021-06-04 20:09:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-04 20:09:20 +0300 |
commit | 72a83dedec5d1c86237f6b5a5857f9b448662b8b (patch) | |
tree | b58329604de99a57581fe7e375996ba3180d5a8d /core/Profiler.php | |
parent | 8b4b8ce017c15a534101fc10494a9f05cb824a58 (diff) |
fix usort() in SQL Profiler (#17645)
Diffstat (limited to 'core/Profiler.php')
-rw-r--r-- | core/Profiler.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/Profiler.php b/core/Profiler.php index 1f69c24266..4b21ddc803 100644 --- a/core/Profiler.php +++ b/core/Profiler.php @@ -100,12 +100,18 @@ class Profiler private static function maxSumMsFirst($a, $b) { - return $a['sum_time_ms'] < $b['sum_time_ms']; + if ($a['sum_time_ms'] == $b['sum_time_ms']) { + return 0; + } + return ($a['sum_time_ms'] < $b['sum_time_ms']) ? -1 : 1; } private static function sortTimeDesc($a, $b) { - return $a['sumTimeMs'] < $b['sumTimeMs']; + if ($a['sumTimeMs'] == $b['sumTimeMs']) { + return 0; + } + return ($a['sumTimeMs'] < $b['sumTimeMs']) ? -1 : 1; } /** |