Coverage Report

Created: 2026-02-14 08:01

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
20.7M
{
31
20.7M
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
18.0M
        AK::insertion_sort(col, start, end, less_than);
33
18.0M
        return;
34
18.0M
    }
35
36
13.0M
    while (start < end) {
37
10.3M
        int size = end - start + 1;
38
10.3M
        if (size > 3) {
39
8.15M
            int third = size / 3;
40
8.15M
            if (less_than(col[start + third], col[end - third])) {
41
5.24M
                swap(col[start + third], col[start]);
42
5.24M
                swap(col[end - third], col[end]);
43
5.24M
            } else {
44
2.90M
                swap(col[start + third], col[end]);
45
2.90M
                swap(col[end - third], col[start]);
46
2.90M
            }
47
8.15M
        } else {
48
2.18M
            if (!less_than(col[start], col[end])) {
49
979k
                swap(col[start], col[end]);
50
979k
            }
51
2.18M
        }
52
53
10.3M
        int j = start + 1;
54
10.3M
        int k = start + 1;
55
10.3M
        int g = end - 1;
56
57
10.3M
        auto&& left_pivot = col[start];
58
10.3M
        auto&& right_pivot = col[end];
59
60
317M
        while (k <= g) {
61
307M
            if (less_than(col[k], left_pivot)) {
62
149M
                swap(col[k], col[j]);
63
149M
                j++;
64
157M
            } else if (!less_than(col[k], right_pivot)) {
65
137M
                while (!less_than(col[g], right_pivot) && k < g) {
66
124M
                    g--;
67
124M
                }
68
12.7M
                swap(col[k], col[g]);
69
12.7M
                g--;
70
12.7M
                if (less_than(col[k], left_pivot)) {
71
6.29M
                    swap(col[k], col[j]);
72
6.29M
                    j++;
73
6.29M
                }
74
12.7M
            }
75
307M
            k++;
76
307M
        }
77
10.3M
        j--;
78
10.3M
        g++;
79
80
10.3M
        swap(col[start], col[j]);
81
10.3M
        swap(col[end], col[g]);
82
83
10.3M
        int left_pointer = j;
84
10.3M
        int right_pointer = g;
85
86
10.3M
        int left_size = left_pointer - start;
87
10.3M
        int middle_size = right_pointer - (left_pointer + 1);
88
10.3M
        int right_size = (end + 1) - (right_pointer + 1);
89
90
10.3M
        if (left_size >= middle_size && left_size >= right_size) {
91
6.85M
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
6.85M
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
6.85M
            end = left_pointer - 1;
94
6.85M
        } else if (middle_size >= right_size) {
95
2.40M
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
2.40M
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
2.40M
            start = left_pointer + 1;
98
2.40M
            end = right_pointer - 1;
99
2.40M
        } else {
100
1.07M
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
1.07M
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
1.07M
            start = right_pointer + 1;
103
1.07M
        }
104
10.3M
    }
105
2.71M
}
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
74.8k
{
31
74.8k
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
74.8k
        AK::insertion_sort(col, start, end, less_than);
33
74.8k
        return;
34
74.8k
    }
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.51k
{
31
3.51k
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
3.51k
        AK::insertion_sort(col, start, end, less_than);
33
3.51k
        return;
34
3.51k
    }
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
18.5M
{
31
18.5M
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
16.2M
        AK::insertion_sort(col, start, end, less_than);
33
16.2M
        return;
34
16.2M
    }
35
36
11.6M
    while (start < end) {
37
9.28M
        int size = end - start + 1;
38
9.28M
        if (size > 3) {
39
7.37M
            int third = size / 3;
40
7.37M
            if (less_than(col[start + third], col[end - third])) {
41
4.49M
                swap(col[start + third], col[start]);
42
4.49M
                swap(col[end - third], col[end]);
43
4.49M
            } else {
44
2.88M
                swap(col[start + third], col[end]);
45
2.88M
                swap(col[end - third], col[start]);
46
2.88M
            }
47
7.37M
        } else {
48
1.90M
            if (!less_than(col[start], col[end])) {
49
952k
                swap(col[start], col[end]);
50
952k
            }
51
1.90M
        }
52
53
9.28M
        int j = start + 1;
54
9.28M
        int k = start + 1;
55
9.28M
        int g = end - 1;
56
57
9.28M
        auto&& left_pivot = col[start];
58
9.28M
        auto&& right_pivot = col[end];
59
60
284M
        while (k <= g) {
61
275M
            if (less_than(col[k], left_pivot)) {
62
134M
                swap(col[k], col[j]);
63
134M
                j++;
64
141M
            } else if (!less_than(col[k], right_pivot)) {
65
122M
                while (!less_than(col[g], right_pivot) && k < g) {
66
110M
                    g--;
67
110M
                }
68
11.9M
                swap(col[k], col[g]);
69
11.9M
                g--;
70
11.9M
                if (less_than(col[k], left_pivot)) {
71
6.24M
                    swap(col[k], col[j]);
72
6.24M
                    j++;
73
6.24M
                }
74
11.9M
            }
75
275M
            k++;
76
275M
        }
77
9.28M
        j--;
78
9.28M
        g++;
79
80
9.28M
        swap(col[start], col[j]);
81
9.28M
        swap(col[end], col[g]);
82
83
9.28M
        int left_pointer = j;
84
9.28M
        int right_pointer = g;
85
86
9.28M
        int left_size = left_pointer - start;
87
9.28M
        int middle_size = right_pointer - (left_pointer + 1);
88
9.28M
        int right_size = (end + 1) - (right_pointer + 1);
89
90
9.28M
        if (left_size >= middle_size && left_size >= right_size) {
91
5.96M
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
5.96M
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
5.96M
            end = left_pointer - 1;
94
5.96M
        } else if (middle_size >= right_size) {
95
2.26M
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
2.26M
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
2.26M
            start = left_pointer + 1;
98
2.26M
            end = right_pointer - 1;
99
2.26M
        } else {
100
1.05M
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
1.05M
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
1.05M
            start = right_pointer + 1;
103
1.05M
        }
104
9.28M
    }
105
2.35M
}
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
1.38k
{
31
1.38k
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
1.38k
        AK::insertion_sort(col, start, end, less_than);
33
1.38k
        return;
34
1.38k
    }
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
672k
{
31
672k
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
562k
        AK::insertion_sort(col, start, end, less_than);
33
562k
        return;
34
562k
    }
35
36
446k
    while (start < end) {
37
335k
        int size = end - start + 1;
38
335k
        if (size > 3) {
39
259k
            int third = size / 3;
40
259k
            if (less_than(col[start + third], col[end - third])) {
41
243k
                swap(col[start + third], col[start]);
42
243k
                swap(col[end - third], col[end]);
43
243k
            } else {
44
16.2k
                swap(col[start + third], col[end]);
45
16.2k
                swap(col[end - third], col[start]);
46
16.2k
            }
47
259k
        } else {
48
75.9k
            if (!less_than(col[start], col[end])) {
49
7.03k
                swap(col[start], col[end]);
50
7.03k
            }
51
75.9k
        }
52
53
335k
        int j = start + 1;
54
335k
        int k = start + 1;
55
335k
        int g = end - 1;
56
57
335k
        auto&& left_pivot = col[start];
58
335k
        auto&& right_pivot = col[end];
59
60
11.6M
        while (k <= g) {
61
11.3M
            if (less_than(col[k], left_pivot)) {
62
5.65M
                swap(col[k], col[j]);
63
5.65M
                j++;
64
5.65M
            } else if (!less_than(col[k], right_pivot)) {
65
5.56M
                while (!less_than(col[g], right_pivot) && k < g) {
66
5.28M
                    g--;
67
5.28M
                }
68
280k
                swap(col[k], col[g]);
69
280k
                g--;
70
280k
                if (less_than(col[k], left_pivot)) {
71
32.3k
                    swap(col[k], col[j]);
72
32.3k
                    j++;
73
32.3k
                }
74
280k
            }
75
11.3M
            k++;
76
11.3M
        }
77
335k
        j--;
78
335k
        g++;
79
80
335k
        swap(col[start], col[j]);
81
335k
        swap(col[end], col[g]);
82
83
335k
        int left_pointer = j;
84
335k
        int right_pointer = g;
85
86
335k
        int left_size = left_pointer - start;
87
335k
        int middle_size = right_pointer - (left_pointer + 1);
88
335k
        int right_size = (end + 1) - (right_pointer + 1);
89
90
335k
        if (left_size >= middle_size && left_size >= right_size) {
91
294k
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
294k
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
294k
            end = left_pointer - 1;
94
294k
        } else if (middle_size >= right_size) {
95
34.3k
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
34.3k
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
34.3k
            start = left_pointer + 1;
98
34.3k
            end = right_pointer - 1;
99
34.3k
        } else {
100
6.85k
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
6.85k
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
6.85k
            start = right_pointer + 1;
103
6.85k
        }
104
335k
    }
105
110k
}
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
155
{
31
155
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
155
        AK::insertion_sort(col, start, end, less_than);
33
155
        return;
34
155
    }
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
1.44M
{
31
1.44M
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
1.18M
        AK::insertion_sort(col, start, end, less_than);
33
1.18M
        return;
34
1.18M
    }
35
36
978k
    while (start < end) {
37
721k
        int size = end - start + 1;
38
721k
        if (size > 3) {
39
517k
            int third = size / 3;
40
517k
            if (less_than(col[start + third], col[end - third])) {
41
508k
                swap(col[start + third], col[start]);
42
508k
                swap(col[end - third], col[end]);
43
508k
            } else {
44
9.03k
                swap(col[start + third], col[end]);
45
9.03k
                swap(col[end - third], col[start]);
46
9.03k
            }
47
517k
        } else {
48
204k
            if (!less_than(col[start], col[end])) {
49
20.0k
                swap(col[start], col[end]);
50
20.0k
            }
51
204k
        }
52
53
721k
        int j = start + 1;
54
721k
        int k = start + 1;
55
721k
        int g = end - 1;
56
57
721k
        auto&& left_pivot = col[start];
58
721k
        auto&& right_pivot = col[end];
59
60
21.0M
        while (k <= g) {
61
20.3M
            if (less_than(col[k], left_pivot)) {
62
10.1M
                swap(col[k], col[j]);
63
10.1M
                j++;
64
10.1M
            } else if (!less_than(col[k], right_pivot)) {
65
9.99M
                while (!less_than(col[g], right_pivot) && k < g) {
66
9.47M
                    g--;
67
9.47M
                }
68
518k
                swap(col[k], col[g]);
69
518k
                g--;
70
518k
                if (less_than(col[k], left_pivot)) {
71
17.9k
                    swap(col[k], col[j]);
72
17.9k
                    j++;
73
17.9k
                }
74
518k
            }
75
20.3M
            k++;
76
20.3M
        }
77
721k
        j--;
78
721k
        g++;
79
80
721k
        swap(col[start], col[j]);
81
721k
        swap(col[end], col[g]);
82
83
721k
        int left_pointer = j;
84
721k
        int right_pointer = g;
85
86
721k
        int left_size = left_pointer - start;
87
721k
        int middle_size = right_pointer - (left_pointer + 1);
88
721k
        int right_size = (end + 1) - (right_pointer + 1);
89
90
721k
        if (left_size >= middle_size && left_size >= right_size) {
91
598k
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
92
598k
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
93
598k
            end = left_pointer - 1;
94
598k
        } else if (middle_size >= right_size) {
95
112k
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
96
112k
            dual_pivot_quick_sort(col, right_pointer + 1, end, less_than);
97
112k
            start = left_pointer + 1;
98
112k
            end = right_pointer - 1;
99
112k
        } else {
100
11.1k
            dual_pivot_quick_sort(col, start, left_pointer - 1, less_than);
101
11.1k
            dual_pivot_quick_sort(col, left_pointer + 1, right_pointer - 1, less_than);
102
11.1k
            start = right_pointer + 1;
103
11.1k
        }
104
721k
    }
105
256k
}
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
339
{
31
339
    if ((end + 1) - start <= INSERTION_SORT_CUTOFF) {
32
339
        AK::insertion_sort(col, start, end, less_than);
33
339
        return;
34
339
    }
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
84.0k
{
157
84.0k
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
84.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
74.8k
{
157
74.8k
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
74.8k
}
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
4.74k
{
157
4.74k
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
4.74k
}
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
1.38k
{
157
1.38k
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
1.38k
}
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
641
{
157
641
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
641
}
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
155
{
157
155
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
155
}
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
1.97k
{
157
1.97k
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
1.97k
}
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
339
{
157
339
    dual_pivot_quick_sort(collection, 0, collection.size() - 1, move(less_than));
158
339
}
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.51k
{
163
3.51k
    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.51k
}
void AK::quick_sort<AK::Vector<unsigned long, 0ul> >(AK::Vector<unsigned long, 0ul>&)
Line
Count
Source
162
3.51k
{
163
3.51k
    dual_pivot_quick_sort(collection, 0, collection.size() - 1,
164
3.51k
        [](auto& a, auto& b) { return a < b; });
165
3.51k
}
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