From 105c516a78c1798ad143b8f899ba98550e2d5f5f Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 13 Jun 2022 07:51:26 +0100 Subject: [PATCH] LibJS: Make array_merge_sort() public --- Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp | 2 +- Userland/Libraries/LibJS/Runtime/ArrayPrototype.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp index efbe057e47..0611741114 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp @@ -867,7 +867,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::reverse) return this_object; } -static ThrowCompletionOr array_merge_sort(VM& vm, GlobalObject& global_object, FunctionObject* compare_func, MarkedVector& arr_to_sort) +ThrowCompletionOr array_merge_sort(VM& vm, GlobalObject& global_object, FunctionObject* compare_func, MarkedVector& arr_to_sort) { // FIXME: it would probably be better to switch to insertion sort for small arrays for // better performance diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.h b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.h index 95054cd899..09cf513e5e 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling - * Copyright (c) 2020-2021, Linus Groh + * Copyright (c) 2020-2022, Linus Groh * * SPDX-License-Identifier: BSD-2-Clause */ @@ -58,4 +58,6 @@ private: JS_DECLARE_NATIVE_FUNCTION(group_to_map); }; +ThrowCompletionOr array_merge_sort(VM&, GlobalObject&, FunctionObject* compare_func, MarkedVector& arr_to_sort); + }