mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 04:55:15 +00:00
AK: Use Array iterator instead of indexing outside Array bounds
This commit is contained in:
parent
6817d0701e
commit
daf18e7777
Notes:
sideshowbarker
2024-07-18 21:53:04 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/daf18e77773
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ TEST_CASE(sorts_without_copy)
|
|||
for (size_t i = 0; i < 64; ++i)
|
||||
array[i].value = (64 - i) % 32 + 32;
|
||||
|
||||
AK::single_pivot_quick_sort(&array[0], &array[64], [](auto& a, auto& b) { return a.value < b.value; });
|
||||
AK::single_pivot_quick_sort(array.begin(), array.end(), [](auto& a, auto& b) { return a.value < b.value; });
|
||||
|
||||
for (size_t i = 0; i < 63; ++i)
|
||||
EXPECT(array[i].value <= array[i + 1].value);
|
||||
|
|
Loading…
Add table
Reference in a new issue