1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:37:35 +00:00

CharacterMap: Limit the number of results from the GUI character search

Past a few hundred matches, the search is no longer useful, and takes an
excessive amount of time to recalculate the column widths by measuring
thousands of pieces of text. 250 seems like a reasonable arbitrary
limit, and keeps things nice and snappy. :^)
This commit is contained in:
Sam Atkins 2023-03-05 15:30:36 +00:00 committed by Andreas Kling
parent bb8bd48dc0
commit 1f0f96e6d7
5 changed files with 39 additions and 18 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -28,6 +28,7 @@ static void search_and_print_results(DeprecatedString const& query)
builder.append(display_name);
outln(builder.string_view());
result_count++;
return IterationDecision::Continue;
});
if (result_count == 0)