diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-27 11:48:25 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-27 11:48:25 +0100 |
commit | daf18e7777366d9b26a20d3e5788fa0cb66a7caa (patch) | |
tree | 6e2e6784f984ed083301550b5b3151c8830354e1 /AK/Tests/TestQuickSort.cpp | |
parent | 6817d0701e9f3227fe15b46dd02a96c8ec79a390 (diff) | |
download | serenity-daf18e7777366d9b26a20d3e5788fa0cb66a7caa.zip |
AK: Use Array iterator instead of indexing outside Array bounds
Diffstat (limited to 'AK/Tests/TestQuickSort.cpp')
-rw-r--r-- | AK/Tests/TestQuickSort.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/AK/Tests/TestQuickSort.cpp b/AK/Tests/TestQuickSort.cpp index 8902de967f..d976e07b81 100644 --- a/AK/Tests/TestQuickSort.cpp +++ b/AK/Tests/TestQuickSort.cpp @@ -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); |