mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
Revert "Everywhere: Remove DeprecatedFlyString + any remaining references to it"
This reverts commit 3131e6369f
.
Greatly regressed JavaScript benchmark performance.
This commit is contained in:
parent
45905d6f7b
commit
7c32d1e8a5
Notes:
github-actions[bot]
2025-04-01 13:43:40 +00:00
Author: https://github.com/awesomekling
Commit: 7c32d1e8a5
23 changed files with 298 additions and 13 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <LibTest/TestCase.h>
|
||||
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <cstring>
|
||||
|
@ -138,6 +139,26 @@ TEST_CASE(to_uppercase)
|
|||
EXPECT(ByteString("AbC").to_uppercase() == "ABC");
|
||||
}
|
||||
|
||||
TEST_CASE(flystring)
|
||||
{
|
||||
{
|
||||
DeprecatedFlyString a("foo");
|
||||
DeprecatedFlyString b("foo");
|
||||
EXPECT_EQ(a.impl(), b.impl());
|
||||
}
|
||||
|
||||
{
|
||||
ByteString a = "foo";
|
||||
DeprecatedFlyString b = a;
|
||||
StringBuilder builder;
|
||||
builder.append('f');
|
||||
builder.append("oo"sv);
|
||||
DeprecatedFlyString c = builder.to_byte_string();
|
||||
EXPECT_EQ(a.impl(), b.impl());
|
||||
EXPECT_EQ(a.impl(), c.impl());
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE(replace)
|
||||
{
|
||||
ByteString test_string = "Well, hello Friends!";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue