mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
LibGUI: Speed up Variant string conversion for string data
Add a fast path to Variant::to_deprecated_string() to return a copy if the underlying data is of type DeprecatedString. This improves the performance of models with a lot of string data.
This commit is contained in:
parent
adb1c842c2
commit
99570cb0c4
Notes:
sideshowbarker
2024-07-17 08:25:15 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/99570cb0c4 Pull-request: https://github.com/SerenityOS/serenity/pull/17400
1 changed files with 1 additions and 0 deletions
|
@ -204,6 +204,7 @@ public:
|
|||
{
|
||||
return visit(
|
||||
[](Empty) -> DeprecatedString { return "[null]"; },
|
||||
[](DeprecatedString v) { return v; },
|
||||
[](Gfx::TextAlignment v) { return DeprecatedString::formatted("Gfx::TextAlignment::{}", Gfx::to_string(v)); },
|
||||
[](Gfx::ColorRole v) { return DeprecatedString::formatted("Gfx::ColorRole::{}", Gfx::to_string(v)); },
|
||||
[](Gfx::AlignmentRole v) { return DeprecatedString::formatted("Gfx::AlignmentRole::{}", Gfx::to_string(v)); },
|
||||
|
|
Loading…
Reference in a new issue