Revert "Everywhere: Remove DeprecatedFlyString + any remaining references to it"

This reverts commit 3131e6369f.

Greatly regressed JavaScript benchmark performance.
This commit is contained in:
Andreas Kling 2025-04-01 15:40:13 +02:00
commit 7c32d1e8a5
Notes: github-actions[bot] 2025-04-01 13:43:40 +00:00
23 changed files with 298 additions and 13 deletions

View file

@ -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!";