mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +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
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…
Add table
Add a link
Reference in a new issue