Skip to content

Commit

Permalink
Merge pull request #4865 from sfadschm/sort-debugbar-timeline-4.2
Browse files Browse the repository at this point in the history
[Debug] [4.2] Sort timeline elements by start and duration.
  • Loading branch information
MGatner authored Jun 24, 2021
2 parents 929e5c4 + 3e4415a commit 6797d1f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions system/Debug/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ protected function collectTimelineData($collectors): array
}

// Sort it
$sortArray = [
array_column($data, 'start'), SORT_NUMERIC, SORT_ASC,
array_column($data, 'duration'), SORT_NUMERIC, SORT_DESC,
&$data
];
array_multisort(...$sortArray);

return $data;
}
Expand Down

0 comments on commit 6797d1f

Please sign in to comment.