Coverage Report

Created: 2025-11-16 07:46

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/serenity/AK/QuickSort.h
Line
Count
Source
1
/*
2
 * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
3
 * Copyright (c) 2022, Marc Luqué <marc.luque@outlook.com>
4
 *
5
 * SPDX-License-Identifier: BSD-2-Clause
6
 */
7
8
#pragma once
9
10
#include <AK/InsertionSort.h>
11
#include <AK/StdLibExtras.h>
12
13
namespace AK {
14
15
// This is a dual pivot quick sort. It is quite a bit faster than the single
16
// pivot quick_sort below. The other quick_sort below should only be used when
17
// you are stuck with simple iterators to a container and you don't have access
18
// to the container itself.
19
//
20
// We use a cutoff to insertion sort for partitions of size 7 or smaller.
21
// The idea is to avoid recursion for small partitions.
22
// The value 7 here is a magic number. According to princeton's CS algorithm class
23
// a value between 5 and 15 should work well in most situations:
24
// https://algs4.cs.princeton.edu/23quicksort/
25
26
static constexpr int INSERTION_SORT_CUTOFF = 7;
27
28
template<typename Collection, typename LessThan>
29
void dual_pivot_quick_sort(Collection& col, int start, int end, LessThan less_than)
30
3.22M
{
31
3.22M
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
2.67M
        AK::insertion_sort(col, start, end, less_than);
33
2.67M
        return;
34
2.67M
    }
35
36
2.11M
    while (start < end) {
37
1.57M
        int size = end - start + 1;
38
1.57M
        if (size > 3) {
39
1.22M
            int third = size / 3;
40
1.22M
            if (less_than(col[start + third], col[end - third])) {
41
1.15M
                swap(col[start + third], col[start]);
42
1.15M
                swap(col[end - third], col[end]);
43
1.15M
            } else {
44
77.5k
                swap(col[start + third], col[end]);
45
77.5k
                swap(col[end - third], col[start]);
46
77.5k
            }
47
1.22M
        } else {
48
348k
            if (!less_than(col[start], col[end])) {
49
59.1k
                swap(col[start], col[end]);
50
59.1k
            }
51
348k
        }
52
53
1.57M
        int j = start + 1;
54
1.57M
        int k = start + 1;
55
1.57M
        int g = end - 1;
56
57
1.57M
        auto&& left_pivot = col[start];
58
1.57M
        auto&& right_pivot = col[end];
59
60
50.6M
        while (k <= g) {
61
49.0M
            if (less_than(col[k], left_pivot)) {
62
24.4M
                swap(col[k], col[j]);
63
24.4M
                j++;
64
24.6M
            } else if (!less_than(col[k], right_pivot)) {
65
23.8M
                while (!less_than(col[g], right_pivot) && k < g) {
66
22.5M
                    g--;
67
22.5M
                }
68
1.33M
                swap(col[k], col[g]);
69
1.33M
                g--;
70
1.33M
                if (less_than(col[k], left_pivot)) {
71
169k
                    swap(col[k], col[j]);
72
169k
                    j++;
73
169k
                }
74
1.33M
            }
75
49.0M
            k++;
76
49.0M
        }
77
1.57M
        j--;
78
1.57M
        g++;
79
80
1.57M
        swap(col[start], col[j]);
81
1.57M
        swap(col[end], col[g]);
82
83
1.57M
        int left_pointer = j;
84
1.57M
        int right_pointer = g;
85
86
1.57M
        int left_size = left_pointer - start;
87
1.57M
        int middle_size = right_pointer - (left_pointer + 1);
88
1.57M
        int right_size = (end + 1) - (right_pointer + 1);
89
90
1.57M
        if (left_size >= middle_size && left_size >= right_size) {
91
1.31M
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
1.31M
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
1.31M
            end = left_pointer - 1;
94
1.31M
        } else if (middle_size >= right_size) {
95
213k
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
213k
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
213k
            start = left_pointer + 1;
98
213k
            end = right_pointer - 1;
99
213k
        } else {
100
50.3k
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
50.3k
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
50.3k
            start = right_pointer + 1;
103
50.3k
        }
104
1.57M
    }
105
542k
}
void AK::dual_pivot_quick_sort<AK::Vector<Gfx::ColorStop, 4ul>, Gfx::GradientPaintStyle::add_color_stop(Gfx::ColorStop, bool)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<Gfx::ColorStop, 4ul>&, int, int, Gfx::GradientPaintStyle::add_color_stop(Gfx::ColorStop, bool)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
30
59.9k
{
31
59.9k
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
59.9k
        AK::insertion_sort(col, start, end, less_than);
33
59.9k
        return;
34
59.9k
    }
35
36
0
    while (start < end) {
37
0
        int size = end - start + 1;
38
0
        if (size > 3) {
39
0
            int third = size / 3;
40
0
            if (less_than(col[start + third], col[end - third])) {
41
0
                swap(col[start + third], col[start]);
42
0
                swap(col[end - third], col[end]);
43
0
            } else {
44
0
                swap(col[start + third], col[end]);
45
0
                swap(col[end - third], col[start]);
46
0
            }
47
0
        } else {
48
0
            if (!less_than(col[start], col[end])) {
49
0
                swap(col[start], col[end]);
50
0
            }
51
0
        }
52
53
0
        int j = start + 1;
54
0
        int k = start + 1;
55
0
        int g = end - 1;
56
57
0
        auto&& left_pivot = col[start];
58
0
        auto&& right_pivot = col[end];
59
60
0
        while (k <= g) {
61
0
            if (less_than(col[k], left_pivot)) {
62
0
                swap(col[k], col[j]);
63
0
                j++;
64
0
            } else if (!less_than(col[k], right_pivot)) {
65
0
                while (!less_than(col[g], right_pivot) && k < g) {
66
0
                    g--;
67
0
                }
68
0
                swap(col[k], col[g]);
69
0
                g--;
70
0
                if (less_than(col[k], left_pivot)) {
71
0
                    swap(col[k], col[j]);
72
0
                    j++;
73
0
                }
74
0
            }
75
0
            k++;
76
0
        }
77
0
        j--;
78
0
        g++;
79
80
0
        swap(col[start], col[j]);
81
0
        swap(col[end], col[g]);
82
83
0
        int left_pointer = j;
84
0
        int right_pointer = g;
85
86
0
        int left_size = left_pointer - start;
87
0
        int middle_size = right_pointer - (left_pointer + 1);
88
0
        int right_size = (end + 1) - (right_pointer + 1);
89
90
0
        if (left_size >= middle_size && left_size >= right_size) {
91
0
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
0
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
0
            end = left_pointer - 1;
94
0
        } else if (middle_size >= right_size) {
95
0
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
0
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
0
            start = left_pointer + 1;
98
0
            end = right_pointer - 1;
99
0
        } else {
100
0
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
0
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
0
            start = right_pointer + 1;
103
0
        }
104
0
    }
105
0
}
Unexecuted instantiation: DCTNaturalOrder.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Gfx::Point<unsigned int>, 0ul>, Gfx::JPEGXL::compute_natural_ordering()::$_0>(AK::Vector<Gfx::Point<unsigned int>, 0ul>&, int, int, Gfx::JPEGXL::compute_natural_ordering()::$_0)
Unexecuted instantiation: DCTNaturalOrder.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Gfx::Point<unsigned int>, 0ul>, Gfx::JPEGXL::compute_natural_ordering()::$_1>(AK::Vector<Gfx::Point<unsigned int>, 0ul>&, int, int, Gfx::JPEGXL::compute_natural_ordering()::$_1)
Unexecuted instantiation: FontDatabase.cpp:void AK::dual_pivot_quick_sort<AK::Vector<AK::RefPtr<Gfx::Font>, 0ul>, Gfx::FontDatabase::for_each_font(AK::Function<void (Gfx::Font const&)>)::$_0>(AK::Vector<AK::RefPtr<Gfx::Font>, 0ul>&, int, int, Gfx::FontDatabase::for_each_font(AK::Function<void (Gfx::Font const&)>)::$_0)
Unexecuted instantiation: FontDatabase.cpp:void AK::dual_pivot_quick_sort<AK::Vector<AK::RefPtr<Gfx::Font>, 0ul>, Gfx::FontDatabase::for_each_fixed_width_font(AK::Function<void (Gfx::Font const&)>)::$_0>(AK::Vector<AK::RefPtr<Gfx::Font>, 0ul>&, int, int, Gfx::FontDatabase::for_each_fixed_width_font(AK::Function<void (Gfx::Font const&)>)::$_0)
void AK::dual_pivot_quick_sort<AK::Vector<unsigned long, 0ul>, AK::quick_sort<AK::Vector<unsigned long, 0ul> >(AK::Vector<unsigned long, 0ul>&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<unsigned long, 0ul>&, int, int, AK::quick_sort<AK::Vector<unsigned long, 0ul> >(AK::Vector<unsigned long, 0ul>&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
30
3.48k
{
31
3.48k
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
3.48k
        AK::insertion_sort(col, start, end, less_than);
33
3.48k
        return;
34
3.48k
    }
35
36
0
    while (start < end) {
37
0
        int size = end - start + 1;
38
0
        if (size > 3) {
39
0
            int third = size / 3;
40
0
            if (less_than(col[start + third], col[end - third])) {
41
0
                swap(col[start + third], col[start]);
42
0
                swap(col[end - third], col[end]);
43
0
            } else {
44
0
                swap(col[start + third], col[end]);
45
0
                swap(col[end - third], col[start]);
46
0
            }
47
0
        } else {
48
0
            if (!less_than(col[start], col[end])) {
49
0
                swap(col[start], col[end]);
50
0
            }
51
0
        }
52
53
0
        int j = start + 1;
54
0
        int k = start + 1;
55
0
        int g = end - 1;
56
57
0
        auto&& left_pivot = col[start];
58
0
        auto&& right_pivot = col[end];
59
60
0
        while (k <= g) {
61
0
            if (less_than(col[k], left_pivot)) {
62
0
                swap(col[k], col[j]);
63
0
                j++;
64
0
            } else if (!less_than(col[k], right_pivot)) {
65
0
                while (!less_than(col[g], right_pivot) && k < g) {
66
0
                    g--;
67
0
                }
68
0
                swap(col[k], col[g]);
69
0
                g--;
70
0
                if (less_than(col[k], left_pivot)) {
71
0
                    swap(col[k], col[j]);
72
0
                    j++;
73
0
                }
74
0
            }
75
0
            k++;
76
0
        }
77
0
        j--;
78
0
        g++;
79
80
0
        swap(col[start], col[j]);
81
0
        swap(col[end], col[g]);
82
83
0
        int left_pointer = j;
84
0
        int right_pointer = g;
85
86
0
        int left_size = left_pointer - start;
87
0
        int middle_size = right_pointer - (left_pointer + 1);
88
0
        int right_size = (end + 1) - (right_pointer + 1);
89
90
0
        if (left_size >= middle_size && left_size >= right_size) {
91
0
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
0
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
0
            end = left_pointer - 1;
94
0
        } else if (middle_size >= right_size) {
95
0
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
0
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
0
            start = left_pointer + 1;
98
0
            end = right_pointer - 1;
99
0
        } else {
100
0
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
0
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
0
            start = right_pointer + 1;
103
0
        }
104
0
    }
105
0
}
Unexecuted instantiation: AST.cpp:void AK::dual_pivot_quick_sort<AK::Vector<JS::ImportAttribute, 0ul>, JS::ModuleRequest::ModuleRequest(AK::DeprecatedFlyString, AK::Vector<JS::ImportAttribute, 0ul>)::$_0>(AK::Vector<JS::ImportAttribute, 0ul>&, int, int, JS::ModuleRequest::ModuleRequest(AK::DeprecatedFlyString, AK::Vector<JS::ImportAttribute, 0ul>)::$_0)
Unexecuted instantiation: Generator.cpp:void AK::dual_pivot_quick_sort<AK::Vector<JS::Bytecode::Executable::ExceptionHandlers, 0ul>, JS::Bytecode::Generator::compile(JS::VM&, JS::ASTNode const&, JS::FunctionKind, JS::GCPtr<JS::ECMAScriptFunctionObject const>, JS::Bytecode::Generator::MustPropagateCompletion, AK::Vector<AK::DeprecatedFlyString, 0ul>)::$_2>(AK::Vector<JS::Bytecode::Executable::ExceptionHandlers, 0ul>&, int, int, JS::Bytecode::Generator::compile(JS::VM&, JS::ASTNode const&, JS::FunctionKind, JS::GCPtr<JS::ECMAScriptFunctionObject const>, JS::Bytecode::Generator::MustPropagateCompletion, AK::Vector<AK::DeprecatedFlyString, 0ul>)::$_2)
Unexecuted instantiation: void AK::dual_pivot_quick_sort<AK::Vector<unsigned int, 0ul>, AK::quick_sort<AK::Vector<unsigned int, 0ul> >(AK::Vector<unsigned int, 0ul>&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<unsigned int, 0ul>&, int, int, AK::quick_sort<AK::Vector<unsigned int, 0ul> >(AK::Vector<unsigned int, 0ul>&)::{lambda(auto:1&, auto:2&)#1})
Unexecuted instantiation: void AK::dual_pivot_quick_sort<AK::Vector<AK::String, 0ul>, AK::quick_sort<AK::Vector<AK::String, 0ul> >(AK::Vector<AK::String, 0ul>&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<AK::String, 0ul>&, int, int, AK::quick_sort<AK::Vector<AK::String, 0ul> >(AK::Vector<AK::String, 0ul>&)::{lambda(auto:1&, auto:2&)#1})
Unexecuted instantiation: void AK::dual_pivot_quick_sort<AK::Vector<AK::StringView, 0ul>, AK::quick_sort<AK::Vector<AK::StringView, 0ul> >(AK::Vector<AK::StringView, 0ul>&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<AK::StringView, 0ul>&, int, int, AK::quick_sort<AK::Vector<AK::StringView, 0ul> >(AK::Vector<AK::StringView, 0ul>&)::{lambda(auto:1&, auto:2&)#1})
Unexecuted instantiation: ModuleNamespaceObject.cpp:void AK::dual_pivot_quick_sort<AK::Vector<AK::DeprecatedFlyString, 0ul>, JS::ModuleNamespaceObject::ModuleNamespaceObject(JS::Realm&, JS::Module*, AK::Vector<AK::DeprecatedFlyString, 0ul>)::$_0>(AK::Vector<AK::DeprecatedFlyString, 0ul>&, int, int, JS::ModuleNamespaceObject::ModuleNamespaceObject(JS::Realm&, JS::Module*, AK::Vector<AK::DeprecatedFlyString, 0ul>)::$_0)
Unexecuted instantiation: SourceTextModule.cpp:void AK::dual_pivot_quick_sort<AK::Vector<JS::module_requests(JS::Program&)::RequestedModuleAndSourceIndex, 0ul>, JS::module_requests(JS::Program&)::$_0>(AK::Vector<JS::module_requests(JS::Program&)::RequestedModuleAndSourceIndex, 0ul>&, int, int, JS::module_requests(JS::Program&)::$_0)
void AK::dual_pivot_quick_sort<AK::Vector<regex::Detail::Block, 0ul>, regex::Regex<regex::PosixBasicParser>::split_basic_blocks(regex::ByteCode const&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<regex::Detail::Block, 0ul>&, int, int, regex::Regex<regex::PosixBasicParser>::split_basic_blocks(regex::ByteCode const&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
30
84.5k
{
31
84.5k
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
72.0k
        AK::insertion_sort(col, start, end, less_than);
33
72.0k
        return;
34
72.0k
    }
35
36
54.6k
    while (start < end) {
37
42.1k
        int size = end - start + 1;
38
42.1k
        if (size > 3) {
39
31.9k
            int third = size / 3;
40
31.9k
            if (less_than(col[start + third], col[end - third])) {
41
23.9k
                swap(col[start + third], col[start]);
42
23.9k
                swap(col[end - third], col[end]);
43
23.9k
            } else {
44
7.99k
                swap(col[start + third], col[end]);
45
7.99k
                swap(col[end - third], col[start]);
46
7.99k
            }
47
31.9k
        } else {
48
10.2k
            if (!less_than(col[start], col[end])) {
49
5.11k
                swap(col[start], col[end]);
50
5.11k
            }
51
10.2k
        }
52
53
42.1k
        int j = start + 1;
54
42.1k
        int k = start + 1;
55
42.1k
        int g = end - 1;
56
57
42.1k
        auto&& left_pivot = col[start];
58
42.1k
        auto&& right_pivot = col[end];
59
60
968k
        while (k <= g) {
61
926k
            if (less_than(col[k], left_pivot)) {
62
457k
                swap(col[k], col[j]);
63
457k
                j++;
64
468k
            } else if (!less_than(col[k], right_pivot)) {
65
417k
                while (!less_than(col[g], right_pivot) && k < g) {
66
379k
                    g--;
67
379k
                }
68
38.2k
                swap(col[k], col[g]);
69
38.2k
                g--;
70
38.2k
                if (less_than(col[k], left_pivot)) {
71
13.6k
                    swap(col[k], col[j]);
72
13.6k
                    j++;
73
13.6k
                }
74
38.2k
            }
75
926k
            k++;
76
926k
        }
77
42.1k
        j--;
78
42.1k
        g++;
79
80
42.1k
        swap(col[start], col[j]);
81
42.1k
        swap(col[end], col[g]);
82
83
42.1k
        int left_pointer = j;
84
42.1k
        int right_pointer = g;
85
86
42.1k
        int left_size = left_pointer - start;
87
42.1k
        int middle_size = right_pointer - (left_pointer + 1);
88
42.1k
        int right_size = (end + 1) - (right_pointer + 1);
89
90
42.1k
        if (left_size >= middle_size && left_size >= right_size) {
91
30.0k
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
30.0k
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
30.0k
            end = left_pointer - 1;
94
30.0k
        } else if (middle_size >= right_size) {
95
8.36k
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
8.36k
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
8.36k
            start = left_pointer + 1;
98
8.36k
            end = right_pointer - 1;
99
8.36k
        } else {
100
3.70k
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
3.70k
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
3.70k
            start = right_pointer + 1;
103
3.70k
        }
104
42.1k
    }
105
12.4k
}
void AK::dual_pivot_quick_sort<AK::Vector<regex::Regex<regex::PosixBasicParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::CandidateBlock, 0ul>, regex::Regex<regex::PosixBasicParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<regex::Regex<regex::PosixBasicParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::CandidateBlock, 0ul>&, int, int, regex::Regex<regex::PosixBasicParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
30
75
{
31
75
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
75
        AK::insertion_sort(col, start, end, less_than);
33
75
        return;
34
75
    }
35
36
0
    while (start < end) {
37
0
        int size = end - start + 1;
38
0
        if (size > 3) {
39
0
            int third = size / 3;
40
0
            if (less_than(col[start + third], col[end - third])) {
41
0
                swap(col[start + third], col[start]);
42
0
                swap(col[end - third], col[end]);
43
0
            } else {
44
0
                swap(col[start + third], col[end]);
45
0
                swap(col[end - third], col[start]);
46
0
            }
47
0
        } else {
48
0
            if (!less_than(col[start], col[end])) {
49
0
                swap(col[start], col[end]);
50
0
            }
51
0
        }
52
53
0
        int j = start + 1;
54
0
        int k = start + 1;
55
0
        int g = end - 1;
56
57
0
        auto&& left_pivot = col[start];
58
0
        auto&& right_pivot = col[end];
59
60
0
        while (k <= g) {
61
0
            if (less_than(col[k], left_pivot)) {
62
0
                swap(col[k], col[j]);
63
0
                j++;
64
0
            } else if (!less_than(col[k], right_pivot)) {
65
0
                while (!less_than(col[g], right_pivot) && k < g) {
66
0
                    g--;
67
0
                }
68
0
                swap(col[k], col[g]);
69
0
                g--;
70
0
                if (less_than(col[k], left_pivot)) {
71
0
                    swap(col[k], col[j]);
72
0
                    j++;
73
0
                }
74
0
            }
75
0
            k++;
76
0
        }
77
0
        j--;
78
0
        g++;
79
80
0
        swap(col[start], col[j]);
81
0
        swap(col[end], col[g]);
82
83
0
        int left_pointer = j;
84
0
        int right_pointer = g;
85
86
0
        int left_size = left_pointer - start;
87
0
        int middle_size = right_pointer - (left_pointer + 1);
88
0
        int right_size = (end + 1) - (right_pointer + 1);
89
90
0
        if (left_size >= middle_size && left_size >= right_size) {
91
0
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
0
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
0
            end = left_pointer - 1;
94
0
        } else if (middle_size >= right_size) {
95
0
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
0
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
0
            start = left_pointer + 1;
98
0
            end = right_pointer - 1;
99
0
        } else {
100
0
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
0
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
0
            start = right_pointer + 1;
103
0
        }
104
0
    }
105
0
}
void AK::dual_pivot_quick_sort<AK::Vector<regex::Detail::Block, 0ul>, regex::Regex<regex::PosixExtendedParser>::split_basic_blocks(regex::ByteCode const&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<regex::Detail::Block, 0ul>&, int, int, regex::Regex<regex::PosixExtendedParser>::split_basic_blocks(regex::ByteCode const&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
30
979k
{
31
979k
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
832k
        AK::insertion_sort(col, start, end, less_than);
33
832k
        return;
34
832k
    }
35
36
636k
    while (start < end) {
37
489k
        int size = end - start + 1;
38
489k
        if (size > 3) {
39
380k
            int third = size / 3;
40
380k
            if (less_than(col[start + third], col[end - third])) {
41
319k
                swap(col[start + third], col[start]);
42
319k
                swap(col[end - third], col[end]);
43
319k
            } else {
44
60.7k
                swap(col[start + third], col[end]);
45
60.7k
                swap(col[end - third], col[start]);
46
60.7k
            }
47
380k
        } else {
48
109k
            if (!less_than(col[start], col[end])) {
49
21.7k
                swap(col[start], col[end]);
50
21.7k
            }
51
109k
        }
52
53
489k
        int j = start + 1;
54
489k
        int k = start + 1;
55
489k
        int g = end - 1;
56
57
489k
        auto&& left_pivot = col[start];
58
489k
        auto&& right_pivot = col[end];
59
60
16.6M
        while (k <= g) {
61
16.1M
            if (less_than(col[k], left_pivot)) {
62
8.04M
                swap(col[k], col[j]);
63
8.04M
                j++;
64
8.13M
            } else if (!less_than(col[k], right_pivot)) {
65
7.71M
                while (!less_than(col[g], right_pivot) && k < g) {
66
7.24M
                    g--;
67
7.24M
                }
68
477k
                swap(col[k], col[g]);
69
477k
                g--;
70
477k
                if (less_than(col[k], left_pivot)) {
71
138k
                    swap(col[k], col[j]);
72
138k
                    j++;
73
138k
                }
74
477k
            }
75
16.1M
            k++;
76
16.1M
        }
77
489k
        j--;
78
489k
        g++;
79
80
489k
        swap(col[start], col[j]);
81
489k
        swap(col[end], col[g]);
82
83
489k
        int left_pointer = j;
84
489k
        int right_pointer = g;
85
86
489k
        int left_size = left_pointer - start;
87
489k
        int middle_size = right_pointer - (left_pointer + 1);
88
489k
        int right_size = (end + 1) - (right_pointer + 1);
89
90
489k
        if (left_size >= middle_size && left_size >= right_size) {
91
393k
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
393k
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
393k
            end = left_pointer - 1;
94
393k
        } else if (middle_size >= right_size) {
95
71.9k
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
71.9k
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
71.9k
            start = left_pointer + 1;
98
71.9k
            end = right_pointer - 1;
99
71.9k
        } else {
100
23.8k
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
23.8k
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
23.8k
            start = right_pointer + 1;
103
23.8k
        }
104
489k
    }
105
147k
}
void AK::dual_pivot_quick_sort<AK::Vector<regex::Regex<regex::PosixExtendedParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::CandidateBlock, 0ul>, regex::Regex<regex::PosixExtendedParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<regex::Regex<regex::PosixExtendedParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::CandidateBlock, 0ul>&, int, int, regex::Regex<regex::PosixExtendedParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
30
167
{
31
167
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
167
        AK::insertion_sort(col, start, end, less_than);
33
167
        return;
34
167
    }
35
36
0
    while (start < end) {
37
0
        int size = end - start + 1;
38
0
        if (size > 3) {
39
0
            int third = size / 3;
40
0
            if (less_than(col[start + third], col[end - third])) {
41
0
                swap(col[start + third], col[start]);
42
0
                swap(col[end - third], col[end]);
43
0
            } else {
44
0
                swap(col[start + third], col[end]);
45
0
                swap(col[end - third], col[start]);
46
0
            }
47
0
        } else {
48
0
            if (!less_than(col[start], col[end])) {
49
0
                swap(col[start], col[end]);
50
0
            }
51
0
        }
52
53
0
        int j = start + 1;
54
0
        int k = start + 1;
55
0
        int g = end - 1;
56
57
0
        auto&& left_pivot = col[start];
58
0
        auto&& right_pivot = col[end];
59
60
0
        while (k <= g) {
61
0
            if (less_than(col[k], left_pivot)) {
62
0
                swap(col[k], col[j]);
63
0
                j++;
64
0
            } else if (!less_than(col[k], right_pivot)) {
65
0
                while (!less_than(col[g], right_pivot) && k < g) {
66
0
                    g--;
67
0
                }
68
0
                swap(col[k], col[g]);
69
0
                g--;
70
0
                if (less_than(col[k], left_pivot)) {
71
0
                    swap(col[k], col[j]);
72
0
                    j++;
73
0
                }
74
0
            }
75
0
            k++;
76
0
        }
77
0
        j--;
78
0
        g++;
79
80
0
        swap(col[start], col[j]);
81
0
        swap(col[end], col[g]);
82
83
0
        int left_pointer = j;
84
0
        int right_pointer = g;
85
86
0
        int left_size = left_pointer - start;
87
0
        int middle_size = right_pointer - (left_pointer + 1);
88
0
        int right_size = (end + 1) - (right_pointer + 1);
89
90
0
        if (left_size >= middle_size && left_size >= right_size) {
91
0
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
0
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
0
            end = left_pointer - 1;
94
0
        } else if (middle_size >= right_size) {
95
0
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
0
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
0
            start = left_pointer + 1;
98
0
            end = right_pointer - 1;
99
0
        } else {
100
0
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
0
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
0
            start = right_pointer + 1;
103
0
        }
104
0
    }
105
0
}
void AK::dual_pivot_quick_sort<AK::Vector<regex::Detail::Block, 0ul>, regex::Regex<regex::ECMA262Parser>::split_basic_blocks(regex::ByteCode const&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<regex::Detail::Block, 0ul>&, int, int, regex::Regex<regex::ECMA262Parser>::split_basic_blocks(regex::ByteCode const&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
30
2.09M
{
31
2.09M
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
1.70M
        AK::insertion_sort(col, start, end, less_than);
33
1.70M
        return;
34
1.70M
    }
35
36
1.42M
    while (start < end) {
37
1.04M
        int size = end - start + 1;
38
1.04M
        if (size > 3) {
39
815k
            int third = size / 3;
40
815k
            if (less_than(col[start + third], col[end - third])) {
41
806k
                swap(col[start + third], col[start]);
42
806k
                swap(col[end - third], col[end]);
43
806k
            } else {
44
8.81k
                swap(col[start + third], col[end]);
45
8.81k
                swap(col[end - third], col[start]);
46
8.81k
            }
47
815k
        } else {
48
229k
            if (!less_than(col[start], col[end])) {
49
32.3k
                swap(col[start], col[end]);
50
32.3k
            }
51
229k
        }
52
53
1.04M
        int j = start + 1;
54
1.04M
        int k = start + 1;
55
1.04M
        int g = end - 1;
56
57
1.04M
        auto&& left_pivot = col[start];
58
1.04M
        auto&& right_pivot = col[end];
59
60
33.0M
        while (k <= g) {
61
31.9M
            if (less_than(col[k], left_pivot)) {
62
15.9M
                swap(col[k], col[j]);
63
15.9M
                j++;
64
16.0M
            } else if (!less_than(col[k], right_pivot)) {
65
15.7M
                while (!less_than(col[g], right_pivot) && k < g) {
66
14.8M
                    g--;
67
14.8M
                }
68
821k
                swap(col[k], col[g]);
69
821k
                g--;
70
821k
                if (less_than(col[k], left_pivot)) {
71
17.5k
                    swap(col[k], col[j]);
72
17.5k
                    j++;
73
17.5k
                }
74
821k
            }
75
31.9M
            k++;
76
31.9M
        }
77
1.04M
        j--;
78
1.04M
        g++;
79
80
1.04M
        swap(col[start], col[j]);
81
1.04M
        swap(col[end], col[g]);
82
83
1.04M
        int left_pointer = j;
84
1.04M
        int right_pointer = g;
85
86
1.04M
        int left_size = left_pointer - start;
87
1.04M
        int middle_size = right_pointer - (left_pointer + 1);
88
1.04M
        int right_size = (end + 1) - (right_pointer + 1);
89
90
1.04M
        if (left_size >= middle_size && left_size >= right_size) {
91
888k
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
888k
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
888k
            end = left_pointer - 1;
94
888k
        } else if (middle_size >= right_size) {
95
133k
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
133k
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
133k
            start = left_pointer + 1;
98
133k
            end = right_pointer - 1;
99
133k
        } else {
100
22.7k
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
22.7k
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
22.7k
            start = right_pointer + 1;
103
22.7k
        }
104
1.04M
    }
105
383k
}
void AK::dual_pivot_quick_sort<AK::Vector<regex::Regex<regex::ECMA262Parser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::CandidateBlock, 0ul>, regex::Regex<regex::ECMA262Parser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<regex::Regex<regex::ECMA262Parser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::CandidateBlock, 0ul>&, int, int, regex::Regex<regex::ECMA262Parser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
30
378
{
31
378
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
378
        AK::insertion_sort(col, start, end, less_than);
33
378
        return;
34
378
    }
35
36
0
    while (start < end) {
37
0
        int size = end - start + 1;
38
0
        if (size > 3) {
39
0
            int third = size / 3;
40
0
            if (less_than(col[start + third], col[end - third])) {
41
0
                swap(col[start + third], col[start]);
42
0
                swap(col[end - third], col[end]);
43
0
            } else {
44
0
                swap(col[start + third], col[end]);
45
0
                swap(col[end - third], col[start]);
46
0
            }
47
0
        } else {
48
0
            if (!less_than(col[start], col[end])) {
49
0
                swap(col[start], col[end]);
50
0
            }
51
0
        }
52
53
0
        int j = start + 1;
54
0
        int k = start + 1;
55
0
        int g = end - 1;
56
57
0
        auto&& left_pivot = col[start];
58
0
        auto&& right_pivot = col[end];
59
60
0
        while (k <= g) {
61
0
            if (less_than(col[k], left_pivot)) {
62
0
                swap(col[k], col[j]);
63
0
                j++;
64
0
            } else if (!less_than(col[k], right_pivot)) {
65
0
                while (!less_than(col[g], right_pivot) && k < g) {
66
0
                    g--;
67
0
                }
68
0
                swap(col[k], col[g]);
69
0
                g--;
70
0
                if (less_than(col[k], left_pivot)) {
71
0
                    swap(col[k], col[j]);
72
0
                    j++;
73
0
                }
74
0
            }
75
0
            k++;
76
0
        }
77
0
        j--;
78
0
        g++;
79
80
0
        swap(col[start], col[j]);
81
0
        swap(col[end], col[g]);
82
83
0
        int left_pointer = j;
84
0
        int right_pointer = g;
85
86
0
        int left_size = left_pointer - start;
87
0
        int middle_size = right_pointer - (left_pointer + 1);
88
0
        int right_size = (end + 1) - (right_pointer + 1);
89
90
0
        if (left_size >= middle_size && left_size >= right_size) {
91
0
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
0
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
0
            end = left_pointer - 1;
94
0
        } else if (middle_size >= right_size) {
95
0
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
0
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
0
            start = left_pointer + 1;
98
0
            end = right_pointer - 1;
99
0
        } else {
100
0
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
0
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
0
            start = right_pointer + 1;
103
0
        }
104
0
    }
105
0
}
Unexecuted instantiation: Locale.cpp:void AK::dual_pivot_quick_sort<AK::Vector<AK::Variant<Locale::LocaleExtension, Locale::TransformedExtension, Locale::OtherExtension>, 0ul>, Locale::transform_unicode_locale_id_to_canonical_syntax(Locale::LocaleID&)::$_3>(AK::Vector<AK::Variant<Locale::LocaleExtension, Locale::TransformedExtension, Locale::OtherExtension>, 0ul>&, int, int, Locale::transform_unicode_locale_id_to_canonical_syntax(Locale::LocaleID&)::$_3)
Unexecuted instantiation: Locale.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Locale::Keyword, 0ul>, Locale::transform_unicode_locale_id_to_canonical_syntax(Locale::LocaleID&)::$_0::operator()(Locale::LocaleExtension&) const::{lambda(auto:1 const&, auto:2 const&)#1}>(AK::Vector<Locale::Keyword, 0ul>&, int, int, Locale::transform_unicode_locale_id_to_canonical_syntax(Locale::LocaleID&)::$_0::operator()(Locale::LocaleExtension&) const::{lambda(auto:1 const&, auto:2 const&)#1})
Unexecuted instantiation: Locale.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Locale::TransformedField, 0ul>, Locale::transform_unicode_locale_id_to_canonical_syntax(Locale::LocaleID&)::$_1::operator()(Locale::TransformedExtension&) const::{lambda(auto:1 const&, auto:2 const&)#1}>(AK::Vector<Locale::TransformedField, 0ul>&, int, int, Locale::transform_unicode_locale_id_to_canonical_syntax(Locale::LocaleID&)::$_1::operator()(Locale::TransformedExtension&) const::{lambda(auto:1 const&, auto:2 const&)#1})
Unexecuted instantiation: void AK::dual_pivot_quick_sort<AK::Vector<AK::ByteString, 0ul>, AK::quick_sort<AK::Vector<AK::ByteString, 0ul> >(AK::Vector<AK::ByteString, 0ul>&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<AK::ByteString, 0ul>&, int, int, AK::quick_sort<AK::Vector<AK::ByteString, 0ul> >(AK::Vector<AK::ByteString, 0ul>&)::{lambda(auto:1&, auto:2&)#1})
Unexecuted instantiation: void AK::dual_pivot_quick_sort<AK::Vector<Shell::Shell::RunnablePath, 256ul>, AK::quick_sort<AK::Vector<Shell::Shell::RunnablePath, 256ul> >(AK::Vector<Shell::Shell::RunnablePath, 256ul>&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<Shell::Shell::RunnablePath, 256ul>&, int, int, AK::quick_sort<AK::Vector<Shell::Shell::RunnablePath, 256ul> >(AK::Vector<Shell::Shell::RunnablePath, 256ul>&)::{lambda(auto:1&, auto:2&)#1})
Unexecuted instantiation: Shell.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Line::CompletionSuggestion, 0ul>, Shell::Shell::complete_path(AK::StringView, AK::StringView, unsigned long, Shell::Shell::ExecutableOnly, Shell::AST::Node const*, Shell::AST::Node const*, Shell::Shell::EscapeMode)::$_0>(AK::Vector<Line::CompletionSuggestion, 0ul>&, int, int, Shell::Shell::complete_path(AK::StringView, AK::StringView, unsigned long, Shell::Shell::ExecutableOnly, Shell::AST::Node const*, Shell::AST::Node const*, Shell::Shell::EscapeMode)::$_0)
Unexecuted instantiation: void AK::dual_pivot_quick_sort<AK::Vector<float, 0ul>, AK::quick_sort<AK::Vector<float, 0ul> >(AK::Vector<float, 0ul>&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<float, 0ul>&, int, int, AK::quick_sort<AK::Vector<float, 0ul> >(AK::Vector<float, 0ul>&)::{lambda(auto:1&, auto:2&)#1})
Unexecuted instantiation: Builtin.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Shell::Shell::builtin_set(Main::Arguments)::Variable, 0ul>, Shell::Shell::builtin_set(Main::Arguments)::$_0>(AK::Vector<Shell::Shell::builtin_set(Main::Arguments)::Variable, 0ul>&, int, int, Shell::Shell::builtin_set(Main::Arguments)::$_0)
Unexecuted instantiation: Builtin.cpp:void AK::dual_pivot_quick_sort<AK::Vector<AK::String, 0ul>, Shell::Shell::builtin_set(Main::Arguments)::$_1>(AK::Vector<AK::String, 0ul>&, int, int, Shell::Shell::builtin_set(Main::Arguments)::$_1)
Unexecuted instantiation: Image.cpp:void AK::dual_pivot_quick_sort<AK::Vector<ELF::Image::SortedSymbol, 0ul>, ELF::Image::sort_symbols() const::$_1>(AK::Vector<ELF::Image::SortedSymbol, 0ul>&, int, int, ELF::Image::sort_symbols() const::$_1)
Unexecuted instantiation: void AK::dual_pivot_quick_sort<AK::Vector<Web::Painting::ColorStop, 4ul>, Web::Painting::SVGGradientPaintStyle::add_color_stop(Web::Painting::ColorStop, bool)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<Web::Painting::ColorStop, 4ul>&, int, int, Web::Painting::SVGGradientPaintStyle::add_color_stop(Web::Painting::ColorStop, bool)::{lambda(auto:1&, auto:2&)#1})
Unexecuted instantiation: Parser.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Web::CSS::ValueComparingNonnullRefPtr<Web::CSS::CSSStyleValue const>, 0ul>, Web::CSS::Parser::Parser::parse_font_feature_settings_value(Web::CSS::Parser::TokenStream<Web::CSS::Parser::ComponentValue>&)::$_0>(AK::Vector<Web::CSS::ValueComparingNonnullRefPtr<Web::CSS::CSSStyleValue const>, 0ul>&, int, int, Web::CSS::Parser::Parser::parse_font_feature_settings_value(Web::CSS::Parser::TokenStream<Web::CSS::Parser::ComponentValue>&)::$_0)
Unexecuted instantiation: Parser.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Web::CSS::ValueComparingNonnullRefPtr<Web::CSS::CSSStyleValue const>, 0ul>, Web::CSS::Parser::Parser::parse_font_variation_settings_value(Web::CSS::Parser::TokenStream<Web::CSS::Parser::ComponentValue>&)::$_0>(AK::Vector<Web::CSS::ValueComparingNonnullRefPtr<Web::CSS::CSSStyleValue const>, 0ul>&, int, int, Web::CSS::Parser::Parser::parse_font_variation_settings_value(Web::CSS::Parser::TokenStream<Web::CSS::Parser::ComponentValue>&)::$_0)
Unexecuted instantiation: StyleComputer.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Web::CSS::MatchingRule, 0ul>, Web::CSS::sort_matching_rules(AK::Vector<Web::CSS::MatchingRule, 0ul>&)::$_0>(AK::Vector<Web::CSS::MatchingRule, 0ul>&, int, int, Web::CSS::sort_matching_rules(AK::Vector<Web::CSS::MatchingRule, 0ul>&)::$_0)
Unexecuted instantiation: StyleComputer.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Web::CSS::StyleComputer::MatchingFontCandidate, 0ul>, Web::CSS::StyleComputer::font_matching_algorithm(Web::CSS::FontFaceKey const&, float) const::$_3>(AK::Vector<Web::CSS::StyleComputer::MatchingFontCandidate, 0ul>&, int, int, Web::CSS::StyleComputer::font_matching_algorithm(Web::CSS::FontFaceKey const&, float) const::$_3)
Unexecuted instantiation: Animatable.cpp:void AK::dual_pivot_quick_sort<AK::Vector<JS::NonnullGCPtr<Web::Animations::Animation>, 0ul>, Web::Animations::Animatable::get_animations_internal(Web::Animations::GetAnimationsOptions)::$_0>(AK::Vector<JS::NonnullGCPtr<Web::Animations::Animation>, 0ul>&, int, int, Web::Animations::Animatable::get_animations_internal(Web::Animations::GetAnimationsOptions)::$_0)
Unexecuted instantiation: KeyframeEffect.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Web::Animations::BaseKeyframe, 0ul>, Web::Animations::process_a_keyframes_argument(JS::Realm&, JS::GCPtr<JS::Object>)::$_0>(AK::Vector<Web::Animations::BaseKeyframe, 0ul>&, int, int, Web::Animations::process_a_keyframes_argument(JS::Realm&, JS::GCPtr<JS::Object>)::$_0)
Unexecuted instantiation: Document.cpp:void AK::dual_pivot_quick_sort<AK::Vector<JS::NonnullGCPtr<Web::Animations::Animation>, 0ul>, Web::DOM::Document::remove_replaced_animations()::$_0>(AK::Vector<JS::NonnullGCPtr<Web::Animations::Animation>, 0ul>&, int, int, Web::DOM::Document::remove_replaced_animations()::$_0)
Unexecuted instantiation: Headers.cpp:void AK::dual_pivot_quick_sort<AK::Vector<AK::Detail::ByteBuffer<32ul>, 0ul>, Web::Fetch::Infrastructure::convert_header_names_to_a_sorted_lowercase_set(AK::Span<AK::Span<unsigned char const> >)::$_0>(AK::Vector<AK::Detail::ByteBuffer<32ul>, 0ul>&, int, int, Web::Fetch::Infrastructure::convert_header_names_to_a_sorted_lowercase_set(AK::Span<AK::Span<unsigned char const> >)::$_0)
Unexecuted instantiation: void AK::dual_pivot_quick_sort<AK::Vector<Web::Bindings::KeyUsage, 0ul>, AK::quick_sort<AK::Vector<Web::Bindings::KeyUsage, 0ul> >(AK::Vector<Web::Bindings::KeyUsage, 0ul>&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<Web::Bindings::KeyUsage, 0ul>&, int, int, AK::quick_sort<AK::Vector<Web::Bindings::KeyUsage, 0ul> >(AK::Vector<Web::Bindings::KeyUsage, 0ul>&)::{lambda(auto:1&, auto:2&)#1})
Unexecuted instantiation: HTMLFormElement.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Web::HTML::HTMLFormElement::supported_property_names() const::SourcedName, 0ul>, Web::HTML::HTMLFormElement::supported_property_names() const::$_0>(AK::Vector<Web::HTML::HTMLFormElement::supported_property_names() const::SourcedName, 0ul>&, int, int, Web::HTML::HTMLFormElement::supported_property_names() const::$_0)
Unexecuted instantiation: SourceSet.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Web::HTML::ImageSource, 0ul>, Web::HTML::SourceSet::select_an_image_source()::$_0>(AK::Vector<Web::HTML::ImageSource, 0ul>&, int, int, Web::HTML::SourceSet::select_an_image_source()::$_0)
Unexecuted instantiation: void AK::dual_pivot_quick_sort<AK::Vector<int, 0ul>, AK::quick_sort<AK::Vector<int, 0ul> >(AK::Vector<int, 0ul>&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<int, 0ul>&, int, int, AK::quick_sort<AK::Vector<int, 0ul> >(AK::Vector<int, 0ul>&)::{lambda(auto:1&, auto:2&)#1})
Unexecuted instantiation: WindowOrWorkerGlobalScope.cpp:void AK::dual_pivot_quick_sort<AK::Vector<JS::Handle<Web::PerformanceTimeline::PerformanceEntry>, 0ul>, Web::HTML::WindowOrWorkerGlobalScopeMixin::filter_buffer_map_by_name_and_type(AK::Optional<AK::String>, AK::Optional<AK::String>) const::$_0>(AK::Vector<JS::Handle<Web::PerformanceTimeline::PerformanceEntry>, 0ul>&, int, int, Web::HTML::WindowOrWorkerGlobalScopeMixin::filter_buffer_map_by_name_and_type(AK::Optional<AK::String>, AK::Optional<AK::String>) const::$_0)
Unexecuted instantiation: IntersectionObserver.cpp:void AK::dual_pivot_quick_sort<AK::Vector<double, 0ul>, Web::IntersectionObserver::IntersectionObserver::construct_impl(JS::Realm&, JS::GCPtr<Web::WebIDL::CallbackType>, Web::IntersectionObserver::IntersectionObserverInit const&)::$_0>(AK::Vector<double, 0ul>&, int, int, Web::IntersectionObserver::IntersectionObserver::construct_impl(JS::Realm&, JS::GCPtr<Web::WebIDL::CallbackType>, Web::IntersectionObserver::IntersectionObserverInit const&)::$_0)
Unexecuted instantiation: FlexFormattingContext.cpp:void AK::dual_pivot_quick_sort<AK::Vector<int, 0ul>, Web::Layout::FlexFormattingContext::generate_anonymous_flex_items()::$_1>(AK::Vector<int, 0ul>&, int, int, Web::Layout::FlexFormattingContext::generate_anonymous_flex_items()::$_1)
Unexecuted instantiation: FlexFormattingContext.cpp:void AK::dual_pivot_quick_sort<AK::Vector<int, 0ul>, Web::Layout::FlexFormattingContext::generate_anonymous_flex_items()::$_2>(AK::Vector<int, 0ul>&, int, int, Web::Layout::FlexFormattingContext::generate_anonymous_flex_items()::$_2)
Unexecuted instantiation: GridFormattingContext.cpp:void AK::dual_pivot_quick_sort<AK::Vector<int, 0ul>, Web::Layout::GridFormattingContext::place_grid_items()::$_1>(AK::Vector<int, 0ul>&, int, int, Web::Layout::GridFormattingContext::place_grid_items()::$_1)
Unexecuted instantiation: Dump.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Web::dump_tree(AK::StringBuilder&, Web::Layout::Node const&, bool, bool, bool)::NameAndValue, 0ul>, Web::dump_tree(AK::StringBuilder&, Web::Layout::Node const&, bool, bool, bool)::$_2>(AK::Vector<Web::dump_tree(AK::StringBuilder&, Web::Layout::Node const&, bool, bool, bool)::NameAndValue, 0ul>&, int, int, Web::dump_tree(AK::StringBuilder&, Web::Layout::Node const&, bool, bool, bool)::$_2)
Unexecuted instantiation: StackingContext.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Web::Painting::StackingContext*, 0ul>, Web::Painting::StackingContext::sort()::$_0>(AK::Vector<Web::Painting::StackingContext*, 0ul>&, int, int, Web::Painting::StackingContext::sort()::$_0)
Unexecuted instantiation: TableBordersPainting.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Web::Painting::BorderEdgePaintingInfo, 0ul>, Web::Painting::paint_collected_edges(Web::PaintContext&, AK::Vector<Web::Painting::BorderEdgePaintingInfo, 0ul>&)::$_0>(AK::Vector<Web::Painting::BorderEdgePaintingInfo, 0ul>&, int, int, Web::Painting::paint_collected_edges(Web::PaintContext&, AK::Vector<Web::Painting::BorderEdgePaintingInfo, 0ul>&)::$_0)
Unexecuted instantiation: PerformanceObserverEntryList.cpp:void AK::dual_pivot_quick_sort<AK::Vector<JS::Handle<Web::PerformanceTimeline::PerformanceEntry>, 0ul>, Web::PerformanceTimeline::filter_buffer_by_name_and_type(AK::Vector<JS::NonnullGCPtr<Web::PerformanceTimeline::PerformanceEntry>, 0ul> const&, AK::Optional<AK::String>, AK::Optional<AK::String>)::$_0>(AK::Vector<JS::Handle<Web::PerformanceTimeline::PerformanceEntry>, 0ul>&, int, int, Web::PerformanceTimeline::filter_buffer_by_name_and_type(AK::Vector<JS::NonnullGCPtr<Web::PerformanceTimeline::PerformanceEntry>, 0ul> const&, AK::Optional<AK::String>, AK::Optional<AK::String>)::$_0)
Unexecuted instantiation: XMLHttpRequest.cpp:void AK::dual_pivot_quick_sort<AK::Vector<Web::Fetch::Infrastructure::Header, 0ul>, Web::XHR::XMLHttpRequest::get_all_response_headers() const::$_0>(AK::Vector<Web::Fetch::Infrastructure::Header, 0ul>&, int, int, Web::XHR::XMLHttpRequest::get_all_response_headers() const::$_0)
106
107
template<typename Iterator, typename LessThan>
108
void single_pivot_quick_sort(Iterator start, Iterator end, LessThan less_than)
109
{
110
    for (;;) {
111
        int size = end - start;
112
        if (size <= 1)
113
            return;
114
115
        int pivot_point = size / 2;
116
        if (pivot_point)
117
            swap(*(start + pivot_point), *start);
118
119
        auto&& pivot = *start;
120
121
        int i = 1;
122
        for (int j = 1; j < size; ++j) {
123
            if (less_than(*(start + j), pivot)) {
124
                swap(*(start + j), *(start + i));
125
                ++i;
126
            }
127
        }
128
129
        swap(*start, *(start + i - 1));
130
        // Recur into the shorter part of the remaining data
131
        // to ensure a stack depth of at most log(n).
132
        if (i > size / 2) {
133
            single_pivot_quick_sort(start + i, end, less_than);
134
            end = start + i - 1;
135
        } else {
136
            single_pivot_quick_sort(start, start + i - 1, less_than);
137
            start = start + i;
138
        }
139
    }
140
}
141
142
template<typename Iterator>
143
void quick_sort(Iterator start, Iterator end)
144
{
145
    single_pivot_quick_sort(start, end, [](auto& a, auto& b) { return a < b; });
146
}
147
148
template<typename Iterator, typename LessThan>
149
void quick_sort(Iterator start, Iterator end, LessThan less_than)
150
{
151
    single_pivot_quick_sort(start, end, move(less_than));
152
}
153
154
template<typename Collection, typename LessThan>
155
void quick_sort(Collection& collection, LessThan less_than)
156
64.0k
{
157
64.0k
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
64.0k
}
void AK::quick_sort<AK::Vector<Gfx::ColorStop, 4ul>, Gfx::GradientPaintStyle::add_color_stop(Gfx::ColorStop, bool)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<Gfx::ColorStop, 4ul>&, Gfx::GradientPaintStyle::add_color_stop(Gfx::ColorStop, bool)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
156
59.9k
{
157
59.9k
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
59.9k
}
Unexecuted instantiation: DCTNaturalOrder.cpp:void AK::quick_sort<AK::Vector<Gfx::Point<unsigned int>, 0ul>, Gfx::JPEGXL::compute_natural_ordering()::$_0>(AK::Vector<Gfx::Point<unsigned int>, 0ul>&, Gfx::JPEGXL::compute_natural_ordering()::$_0)
Unexecuted instantiation: DCTNaturalOrder.cpp:void AK::quick_sort<AK::Vector<Gfx::Point<unsigned int>, 0ul>, Gfx::JPEGXL::compute_natural_ordering()::$_1>(AK::Vector<Gfx::Point<unsigned int>, 0ul>&, Gfx::JPEGXL::compute_natural_ordering()::$_1)
Unexecuted instantiation: FontDatabase.cpp:void AK::quick_sort<AK::Vector<AK::RefPtr<Gfx::Font>, 0ul>, Gfx::FontDatabase::for_each_font(AK::Function<void (Gfx::Font const&)>)::$_0>(AK::Vector<AK::RefPtr<Gfx::Font>, 0ul>&, Gfx::FontDatabase::for_each_font(AK::Function<void (Gfx::Font const&)>)::$_0)
Unexecuted instantiation: FontDatabase.cpp:void AK::quick_sort<AK::Vector<AK::RefPtr<Gfx::Font>, 0ul>, Gfx::FontDatabase::for_each_fixed_width_font(AK::Function<void (Gfx::Font const&)>)::$_0>(AK::Vector<AK::RefPtr<Gfx::Font>, 0ul>&, Gfx::FontDatabase::for_each_fixed_width_font(AK::Function<void (Gfx::Font const&)>)::$_0)
Unexecuted instantiation: AST.cpp:void AK::quick_sort<AK::Vector<JS::ImportAttribute, 0ul>, JS::ModuleRequest::ModuleRequest(AK::DeprecatedFlyString, AK::Vector<JS::ImportAttribute, 0ul>)::$_0>(AK::Vector<JS::ImportAttribute, 0ul>&, JS::ModuleRequest::ModuleRequest(AK::DeprecatedFlyString, AK::Vector<JS::ImportAttribute, 0ul>)::$_0)
Unexecuted instantiation: Generator.cpp:void AK::quick_sort<AK::Vector<JS::Bytecode::Executable::ExceptionHandlers, 0ul>, JS::Bytecode::Generator::compile(JS::VM&, JS::ASTNode const&, JS::FunctionKind, JS::GCPtr<JS::ECMAScriptFunctionObject const>, JS::Bytecode::Generator::MustPropagateCompletion, AK::Vector<AK::DeprecatedFlyString, 0ul>)::$_2>(AK::Vector<JS::Bytecode::Executable::ExceptionHandlers, 0ul>&, JS::Bytecode::Generator::compile(JS::VM&, JS::ASTNode const&, JS::FunctionKind, JS::GCPtr<JS::ECMAScriptFunctionObject const>, JS::Bytecode::Generator::MustPropagateCompletion, AK::Vector<AK::DeprecatedFlyString, 0ul>)::$_2)
Unexecuted instantiation: ModuleNamespaceObject.cpp:void AK::quick_sort<AK::Vector<AK::DeprecatedFlyString, 0ul>, JS::ModuleNamespaceObject::ModuleNamespaceObject(JS::Realm&, JS::Module*, AK::Vector<AK::DeprecatedFlyString, 0ul>)::$_0>(AK::Vector<AK::DeprecatedFlyString, 0ul>&, JS::ModuleNamespaceObject::ModuleNamespaceObject(JS::Realm&, JS::Module*, AK::Vector<AK::DeprecatedFlyString, 0ul>)::$_0)
Unexecuted instantiation: SourceTextModule.cpp:void AK::quick_sort<AK::Vector<JS::module_requests(JS::Program&)::RequestedModuleAndSourceIndex, 0ul>, JS::module_requests(JS::Program&)::$_0>(AK::Vector<JS::module_requests(JS::Program&)::RequestedModuleAndSourceIndex, 0ul>&, JS::module_requests(JS::Program&)::$_0)
void AK::quick_sort<AK::Vector<regex::Detail::Block, 0ul>, regex::Regex<regex::PosixBasicParser>::split_basic_blocks(regex::ByteCode const&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<regex::Detail::Block, 0ul>&, regex::Regex<regex::PosixBasicParser>::split_basic_blocks(regex::ByteCode const&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
156
200
{
157
200
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
200
}
void AK::quick_sort<AK::Vector<regex::Regex<regex::PosixBasicParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::CandidateBlock, 0ul>, regex::Regex<regex::PosixBasicParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<regex::Regex<regex::PosixBasicParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::CandidateBlock, 0ul>&, regex::Regex<regex::PosixBasicParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
156
75
{
157
75
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
75
}
void AK::quick_sort<AK::Vector<regex::Detail::Block, 0ul>, regex::Regex<regex::PosixExtendedParser>::split_basic_blocks(regex::ByteCode const&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<regex::Detail::Block, 0ul>&, regex::Regex<regex::PosixExtendedParser>::split_basic_blocks(regex::ByteCode const&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
156
705
{
157
705
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
705
}
void AK::quick_sort<AK::Vector<regex::Regex<regex::PosixExtendedParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::CandidateBlock, 0ul>, regex::Regex<regex::PosixExtendedParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<regex::Regex<regex::PosixExtendedParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::CandidateBlock, 0ul>&, regex::Regex<regex::PosixExtendedParser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
156
167
{
157
167
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
167
}
void AK::quick_sort<AK::Vector<regex::Detail::Block, 0ul>, regex::Regex<regex::ECMA262Parser>::split_basic_blocks(regex::ByteCode const&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<regex::Detail::Block, 0ul>&, regex::Regex<regex::ECMA262Parser>::split_basic_blocks(regex::ByteCode const&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
156
2.60k
{
157
2.60k
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
2.60k
}
void AK::quick_sort<AK::Vector<regex::Regex<regex::ECMA262Parser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::CandidateBlock, 0ul>, regex::Regex<regex::ECMA262Parser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<regex::Regex<regex::ECMA262Parser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::CandidateBlock, 0ul>&, regex::Regex<regex::ECMA262Parser>::attempt_rewrite_loops_as_atomic_groups(AK::Vector<regex::Detail::Block, 0ul> const&)::{lambda(auto:1&, auto:2&)#1})
Line
Count
Source
156
378
{
157
378
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
378
}
Unexecuted instantiation: Locale.cpp:void AK::quick_sort<AK::Vector<AK::Variant<Locale::LocaleExtension, Locale::TransformedExtension, Locale::OtherExtension>, 0ul>, Locale::transform_unicode_locale_id_to_canonical_syntax(Locale::LocaleID&)::$_3>(AK::Vector<AK::Variant<Locale::LocaleExtension, Locale::TransformedExtension, Locale::OtherExtension>, 0ul>&, Locale::transform_unicode_locale_id_to_canonical_syntax(Locale::LocaleID&)::$_3)
Unexecuted instantiation: Locale.cpp:void AK::quick_sort<AK::Vector<Locale::Keyword, 0ul>, Locale::transform_unicode_locale_id_to_canonical_syntax(Locale::LocaleID&)::$_0::operator()(Locale::LocaleExtension&) const::{lambda(auto:1 const&, auto:2 const&)#1}>(AK::Vector<Locale::Keyword, 0ul>&, Locale::transform_unicode_locale_id_to_canonical_syntax(Locale::LocaleID&)::$_0::operator()(Locale::LocaleExtension&) const::{lambda(auto:1 const&, auto:2 const&)#1})
Unexecuted instantiation: Locale.cpp:void AK::quick_sort<AK::Vector<Locale::TransformedField, 0ul>, Locale::transform_unicode_locale_id_to_canonical_syntax(Locale::LocaleID&)::$_1::operator()(Locale::TransformedExtension&) const::{lambda(auto:1 const&, auto:2 const&)#1}>(AK::Vector<Locale::TransformedField, 0ul>&, Locale::transform_unicode_locale_id_to_canonical_syntax(Locale::LocaleID&)::$_1::operator()(Locale::TransformedExtension&) const::{lambda(auto:1 const&, auto:2 const&)#1})
Unexecuted instantiation: Shell.cpp:void AK::quick_sort<AK::Vector<Line::CompletionSuggestion, 0ul>, Shell::Shell::complete_path(AK::StringView, AK::StringView, unsigned long, Shell::Shell::ExecutableOnly, Shell::AST::Node const*, Shell::AST::Node const*, Shell::Shell::EscapeMode)::$_0>(AK::Vector<Line::CompletionSuggestion, 0ul>&, Shell::Shell::complete_path(AK::StringView, AK::StringView, unsigned long, Shell::Shell::ExecutableOnly, Shell::AST::Node const*, Shell::AST::Node const*, Shell::Shell::EscapeMode)::$_0)
Unexecuted instantiation: Builtin.cpp:void AK::quick_sort<AK::Vector<Shell::Shell::builtin_set(Main::Arguments)::Variable, 0ul>, Shell::Shell::builtin_set(Main::Arguments)::$_0>(AK::Vector<Shell::Shell::builtin_set(Main::Arguments)::Variable, 0ul>&, Shell::Shell::builtin_set(Main::Arguments)::$_0)
Unexecuted instantiation: Builtin.cpp:void AK::quick_sort<AK::Vector<AK::String, 0ul>, Shell::Shell::builtin_set(Main::Arguments)::$_1>(AK::Vector<AK::String, 0ul>&, Shell::Shell::builtin_set(Main::Arguments)::$_1)
Unexecuted instantiation: Image.cpp:void AK::quick_sort<AK::Vector<ELF::Image::SortedSymbol, 0ul>, ELF::Image::sort_symbols() const::$_1>(AK::Vector<ELF::Image::SortedSymbol, 0ul>&, ELF::Image::sort_symbols() const::$_1)
Unexecuted instantiation: void AK::quick_sort<AK::Vector<Web::Painting::ColorStop, 4ul>, Web::Painting::SVGGradientPaintStyle::add_color_stop(Web::Painting::ColorStop, bool)::{lambda(auto:1&, auto:2&)#1}>(AK::Vector<Web::Painting::ColorStop, 4ul>&, Web::Painting::SVGGradientPaintStyle::add_color_stop(Web::Painting::ColorStop, bool)::{lambda(auto:1&, auto:2&)#1})
Unexecuted instantiation: Parser.cpp:void AK::quick_sort<AK::Vector<Web::CSS::ValueComparingNonnullRefPtr<Web::CSS::CSSStyleValue const>, 0ul>, Web::CSS::Parser::Parser::parse_font_feature_settings_value(Web::CSS::Parser::TokenStream<Web::CSS::Parser::ComponentValue>&)::$_0>(AK::Vector<Web::CSS::ValueComparingNonnullRefPtr<Web::CSS::CSSStyleValue const>, 0ul>&, Web::CSS::Parser::Parser::parse_font_feature_settings_value(Web::CSS::Parser::TokenStream<Web::CSS::Parser::ComponentValue>&)::$_0)
Unexecuted instantiation: Parser.cpp:void AK::quick_sort<AK::Vector<Web::CSS::ValueComparingNonnullRefPtr<Web::CSS::CSSStyleValue const>, 0ul>, Web::CSS::Parser::Parser::parse_font_variation_settings_value(Web::CSS::Parser::TokenStream<Web::CSS::Parser::ComponentValue>&)::$_0>(AK::Vector<Web::CSS::ValueComparingNonnullRefPtr<Web::CSS::CSSStyleValue const>, 0ul>&, Web::CSS::Parser::Parser::parse_font_variation_settings_value(Web::CSS::Parser::TokenStream<Web::CSS::Parser::ComponentValue>&)::$_0)
Unexecuted instantiation: StyleComputer.cpp:void AK::quick_sort<AK::Vector<Web::CSS::MatchingRule, 0ul>, Web::CSS::sort_matching_rules(AK::Vector<Web::CSS::MatchingRule, 0ul>&)::$_0>(AK::Vector<Web::CSS::MatchingRule, 0ul>&, Web::CSS::sort_matching_rules(AK::Vector<Web::CSS::MatchingRule, 0ul>&)::$_0)
Unexecuted instantiation: StyleComputer.cpp:void AK::quick_sort<AK::Vector<Web::CSS::StyleComputer::MatchingFontCandidate, 0ul>, Web::CSS::StyleComputer::font_matching_algorithm(Web::CSS::FontFaceKey const&, float) const::$_3>(AK::Vector<Web::CSS::StyleComputer::MatchingFontCandidate, 0ul>&, Web::CSS::StyleComputer::font_matching_algorithm(Web::CSS::FontFaceKey const&, float) const::$_3)
Unexecuted instantiation: Animatable.cpp:void AK::quick_sort<AK::Vector<JS::NonnullGCPtr<Web::Animations::Animation>, 0ul>, Web::Animations::Animatable::get_animations_internal(Web::Animations::GetAnimationsOptions)::$_0>(AK::Vector<JS::NonnullGCPtr<Web::Animations::Animation>, 0ul>&, Web::Animations::Animatable::get_animations_internal(Web::Animations::GetAnimationsOptions)::$_0)
Unexecuted instantiation: KeyframeEffect.cpp:void AK::quick_sort<AK::Vector<Web::Animations::BaseKeyframe, 0ul>, Web::Animations::process_a_keyframes_argument(JS::Realm&, JS::GCPtr<JS::Object>)::$_0>(AK::Vector<Web::Animations::BaseKeyframe, 0ul>&, Web::Animations::process_a_keyframes_argument(JS::Realm&, JS::GCPtr<JS::Object>)::$_0)
Unexecuted instantiation: Document.cpp:void AK::quick_sort<AK::Vector<JS::NonnullGCPtr<Web::Animations::Animation>, 0ul>, Web::DOM::Document::remove_replaced_animations()::$_0>(AK::Vector<JS::NonnullGCPtr<Web::Animations::Animation>, 0ul>&, Web::DOM::Document::remove_replaced_animations()::$_0)
Unexecuted instantiation: Headers.cpp:void AK::quick_sort<AK::Vector<AK::Detail::ByteBuffer<32ul>, 0ul>, Web::Fetch::Infrastructure::convert_header_names_to_a_sorted_lowercase_set(AK::Span<AK::Span<unsigned char const> >)::$_0>(AK::Vector<AK::Detail::ByteBuffer<32ul>, 0ul>&, Web::Fetch::Infrastructure::convert_header_names_to_a_sorted_lowercase_set(AK::Span<AK::Span<unsigned char const> >)::$_0)
Unexecuted instantiation: HTMLFormElement.cpp:void AK::quick_sort<AK::Vector<Web::HTML::HTMLFormElement::supported_property_names() const::SourcedName, 0ul>, Web::HTML::HTMLFormElement::supported_property_names() const::$_0>(AK::Vector<Web::HTML::HTMLFormElement::supported_property_names() const::SourcedName, 0ul>&, Web::HTML::HTMLFormElement::supported_property_names() const::$_0)
Unexecuted instantiation: SourceSet.cpp:void AK::quick_sort<AK::Vector<Web::HTML::ImageSource, 0ul>, Web::HTML::SourceSet::select_an_image_source()::$_0>(AK::Vector<Web::HTML::ImageSource, 0ul>&, Web::HTML::SourceSet::select_an_image_source()::$_0)
Unexecuted instantiation: WindowOrWorkerGlobalScope.cpp:void AK::quick_sort<AK::Vector<JS::Handle<Web::PerformanceTimeline::PerformanceEntry>, 0ul>, Web::HTML::WindowOrWorkerGlobalScopeMixin::filter_buffer_map_by_name_and_type(AK::Optional<AK::String>, AK::Optional<AK::String>) const::$_0>(AK::Vector<JS::Handle<Web::PerformanceTimeline::PerformanceEntry>, 0ul>&, Web::HTML::WindowOrWorkerGlobalScopeMixin::filter_buffer_map_by_name_and_type(AK::Optional<AK::String>, AK::Optional<AK::String>) const::$_0)
Unexecuted instantiation: IntersectionObserver.cpp:void AK::quick_sort<AK::Vector<double, 0ul>, Web::IntersectionObserver::IntersectionObserver::construct_impl(JS::Realm&, JS::GCPtr<Web::WebIDL::CallbackType>, Web::IntersectionObserver::IntersectionObserverInit const&)::$_0>(AK::Vector<double, 0ul>&, Web::IntersectionObserver::IntersectionObserver::construct_impl(JS::Realm&, JS::GCPtr<Web::WebIDL::CallbackType>, Web::IntersectionObserver::IntersectionObserverInit const&)::$_0)
Unexecuted instantiation: FlexFormattingContext.cpp:void AK::quick_sort<AK::Vector<int, 0ul>, Web::Layout::FlexFormattingContext::generate_anonymous_flex_items()::$_1>(AK::Vector<int, 0ul>&, Web::Layout::FlexFormattingContext::generate_anonymous_flex_items()::$_1)
Unexecuted instantiation: FlexFormattingContext.cpp:void AK::quick_sort<AK::Vector<int, 0ul>, Web::Layout::FlexFormattingContext::generate_anonymous_flex_items()::$_2>(AK::Vector<int, 0ul>&, Web::Layout::FlexFormattingContext::generate_anonymous_flex_items()::$_2)
Unexecuted instantiation: GridFormattingContext.cpp:void AK::quick_sort<AK::Vector<int, 0ul>, Web::Layout::GridFormattingContext::place_grid_items()::$_1>(AK::Vector<int, 0ul>&, Web::Layout::GridFormattingContext::place_grid_items()::$_1)
Unexecuted instantiation: Dump.cpp:void AK::quick_sort<AK::Vector<Web::dump_tree(AK::StringBuilder&, Web::Layout::Node const&, bool, bool, bool)::NameAndValue, 0ul>, Web::dump_tree(AK::StringBuilder&, Web::Layout::Node const&, bool, bool, bool)::$_2>(AK::Vector<Web::dump_tree(AK::StringBuilder&, Web::Layout::Node const&, bool, bool, bool)::NameAndValue, 0ul>&, Web::dump_tree(AK::StringBuilder&, Web::Layout::Node const&, bool, bool, bool)::$_2)
Unexecuted instantiation: StackingContext.cpp:void AK::quick_sort<AK::Vector<Web::Painting::StackingContext*, 0ul>, Web::Painting::StackingContext::sort()::$_0>(AK::Vector<Web::Painting::StackingContext*, 0ul>&, Web::Painting::StackingContext::sort()::$_0)
Unexecuted instantiation: TableBordersPainting.cpp:void AK::quick_sort<AK::Vector<Web::Painting::BorderEdgePaintingInfo, 0ul>, Web::Painting::paint_collected_edges(Web::PaintContext&, AK::Vector<Web::Painting::BorderEdgePaintingInfo, 0ul>&)::$_0>(AK::Vector<Web::Painting::BorderEdgePaintingInfo, 0ul>&, Web::Painting::paint_collected_edges(Web::PaintContext&, AK::Vector<Web::Painting::BorderEdgePaintingInfo, 0ul>&)::$_0)
Unexecuted instantiation: PerformanceObserverEntryList.cpp:void AK::quick_sort<AK::Vector<JS::Handle<Web::PerformanceTimeline::PerformanceEntry>, 0ul>, Web::PerformanceTimeline::filter_buffer_by_name_and_type(AK::Vector<JS::NonnullGCPtr<Web::PerformanceTimeline::PerformanceEntry>, 0ul> const&, AK::Optional<AK::String>, AK::Optional<AK::String>)::$_0>(AK::Vector<JS::Handle<Web::PerformanceTimeline::PerformanceEntry>, 0ul>&, Web::PerformanceTimeline::filter_buffer_by_name_and_type(AK::Vector<JS::NonnullGCPtr<Web::PerformanceTimeline::PerformanceEntry>, 0ul> const&, AK::Optional<AK::String>, AK::Optional<AK::String>)::$_0)
Unexecuted instantiation: XMLHttpRequest.cpp:void AK::quick_sort<AK::Vector<Web::Fetch::Infrastructure::Header, 0ul>, Web::XHR::XMLHttpRequest::get_all_response_headers() const::$_0>(AK::Vector<Web::Fetch::Infrastructure::Header, 0ul>&, Web::XHR::XMLHttpRequest::get_all_response_headers() const::$_0)
159
160
template<typename Collection>
161
void quick_sort(Collection& collection)
162
3.48k
{
163
3.48k
    dual_pivot_quick_sort(collection, 0, collection.size() - 1,
164
16.6k
        [](auto& a, auto& b) { return a < b; });
auto AK::quick_sort<AK::Vector<unsigned long, 0ul> >(AK::Vector<unsigned long, 0ul>&)::{lambda(auto:1&, auto:2&)#1}::operator()<unsigned long, unsigned long>(AK::Vector<unsigned long, 0ul>&, unsigned long&) const
Line
Count
Source
164
16.6k
        [](auto& a, auto& b) { return a < b; });
Unexecuted instantiation: auto AK::quick_sort<AK::Vector<unsigned int, 0ul> >(AK::Vector<unsigned int, 0ul>&)::{lambda(auto:1&, auto:2&)#1}::operator()<unsigned int, unsigned int>(AK::Vector<unsigned int, 0ul>&, unsigned int&) const
Unexecuted instantiation: auto AK::quick_sort<AK::Vector<AK::String, 0ul> >(AK::Vector<AK::String, 0ul>&)::{lambda(auto:1&, auto:2&)#1}::operator()<AK::String, AK::String>(AK::Vector<AK::String, 0ul>&, AK::String&) const
Unexecuted instantiation: auto AK::quick_sort<AK::Vector<AK::StringView, 0ul> >(AK::Vector<AK::StringView, 0ul>&)::{lambda(auto:1&, auto:2&)#1}::operator()<AK::StringView, AK::StringView>(AK::Vector<AK::StringView, 0ul>&, AK::StringView&) const
Unexecuted instantiation: auto AK::quick_sort<AK::Vector<AK::ByteString, 0ul> >(AK::Vector<AK::ByteString, 0ul>&)::{lambda(auto:1&, auto:2&)#1}::operator()<AK::ByteString, AK::ByteString>(AK::Vector<AK::ByteString, 0ul>&, AK::ByteString&) const
Unexecuted instantiation: auto AK::quick_sort<AK::Vector<Shell::Shell::RunnablePath, 256ul> >(AK::Vector<Shell::Shell::RunnablePath, 256ul>&)::{lambda(auto:1&, auto:2&)#1}::operator()<Shell::Shell::RunnablePath, Shell::Shell::RunnablePath>(AK::Vector<Shell::Shell::RunnablePath, 256ul>&, Shell::Shell::RunnablePath&) const
Unexecuted instantiation: auto AK::quick_sort<AK::Vector<float, 0ul> >(AK::Vector<float, 0ul>&)::{lambda(auto:1&, auto:2&)#1}::operator()<float, float>(AK::Vector<float, 0ul>&, float&) const
Unexecuted instantiation: auto AK::quick_sort<AK::Vector<Web::Bindings::KeyUsage, 0ul> >(AK::Vector<Web::Bindings::KeyUsage, 0ul>&)::{lambda(auto:1&, auto:2&)#1}::operator()<Web::Bindings::KeyUsage, Web::Bindings::KeyUsage>(AK::Vector<Web::Bindings::KeyUsage, 0ul>&, Web::Bindings::KeyUsage&) const
Unexecuted instantiation: auto AK::quick_sort<AK::Vector<int, 0ul> >(AK::Vector<int, 0ul>&)::{lambda(auto:1&, auto:2&)#1}::operator()<int, int>(AK::Vector<int, 0ul>&, int&) const
165
3.48k
}
void AK::quick_sort<AK::Vector<unsigned long, 0ul> >(AK::Vector<unsigned long, 0ul>&)
Line
Count
Source
162
3.48k
{
163
3.48k
    dual_pivot_quick_sort(collection, 0, collection.size() - 1,
164
3.48k
        [](auto& a, auto& b) { return a < b; });
165
3.48k
}
Unexecuted instantiation: void AK::quick_sort<AK::Vector<unsigned int, 0ul> >(AK::Vector<unsigned int, 0ul>&)
Unexecuted instantiation: void AK::quick_sort<AK::Vector<AK::String, 0ul> >(AK::Vector<AK::String, 0ul>&)
Unexecuted instantiation: void AK::quick_sort<AK::Vector<AK::StringView, 0ul> >(AK::Vector<AK::StringView, 0ul>&)
Unexecuted instantiation: void AK::quick_sort<AK::Vector<AK::ByteString, 0ul> >(AK::Vector<AK::ByteString, 0ul>&)
Unexecuted instantiation: void AK::quick_sort<AK::Vector<Shell::Shell::RunnablePath, 256ul> >(AK::Vector<Shell::Shell::RunnablePath, 256ul>&)
Unexecuted instantiation: void AK::quick_sort<AK::Vector<float, 0ul> >(AK::Vector<float, 0ul>&)
Unexecuted instantiation: void AK::quick_sort<AK::Vector<Web::Bindings::KeyUsage, 0ul> >(AK::Vector<Web::Bindings::KeyUsage, 0ul>&)
Unexecuted instantiation: void AK::quick_sort<AK::Vector<int, 0ul> >(AK::Vector<int, 0ul>&)
166
167
}
168
169
#if USING_AK_GLOBALLY
170
using AK::quick_sort;
171
#endif