mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:07:45 +00:00
Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte string. As the null state has already been removed, there are no other particularly hairy blockers in repurposing this type as a byte string (what it _really_ is). This commit is auto-generated: $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \ Meta Ports Ladybird Tests Kernel) $ perl -pie 's/\bDeprecatedString\b/ByteString/g; s/deprecated_string/byte_string/g' $xs $ clang-format --style=file -i \ $(git diff --name-only | grep \.cpp\|\.h) $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
parent
38d62563b3
commit
5e1499d104
1615 changed files with 10257 additions and 10257 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <LibTest/TestCase.h>
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/ReverseIterator.h>
|
||||
#include <AK/String.h>
|
||||
|
@ -38,18 +38,18 @@ TEST_CASE(ints)
|
|||
|
||||
TEST_CASE(strings)
|
||||
{
|
||||
Vector<DeprecatedString> strings;
|
||||
Vector<ByteString> strings;
|
||||
strings.append("ABC");
|
||||
strings.append("DEF");
|
||||
|
||||
int loop_counter = 0;
|
||||
for (DeprecatedString const& string : strings) {
|
||||
for (ByteString const& string : strings) {
|
||||
EXPECT(!string.is_empty());
|
||||
++loop_counter;
|
||||
}
|
||||
|
||||
loop_counter = 0;
|
||||
for (auto& string : (const_cast<Vector<DeprecatedString> const&>(strings))) {
|
||||
for (auto& string : (const_cast<Vector<ByteString> const&>(strings))) {
|
||||
EXPECT(!string.is_empty());
|
||||
++loop_counter;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ TEST_CASE(strings)
|
|||
|
||||
TEST_CASE(strings_insert_ordered)
|
||||
{
|
||||
Vector<DeprecatedString> strings;
|
||||
Vector<ByteString> strings;
|
||||
strings.append("abc");
|
||||
strings.append("def");
|
||||
strings.append("ghi");
|
||||
|
@ -161,12 +161,12 @@ TEST_CASE(vector_compare)
|
|||
EXPECT_EQ(ints.size(), 1000u);
|
||||
EXPECT_EQ(ints, same_ints);
|
||||
|
||||
Vector<DeprecatedString> strings;
|
||||
Vector<DeprecatedString> same_strings;
|
||||
Vector<ByteString> strings;
|
||||
Vector<ByteString> same_strings;
|
||||
|
||||
for (int i = 0; i < 1000; ++i) {
|
||||
strings.append(DeprecatedString::number(i));
|
||||
same_strings.append(DeprecatedString::number(i));
|
||||
strings.append(ByteString::number(i));
|
||||
same_strings.append(ByteString::number(i));
|
||||
}
|
||||
|
||||
EXPECT_EQ(strings.size(), 1000u);
|
||||
|
@ -176,9 +176,9 @@ TEST_CASE(vector_compare)
|
|||
TEST_CASE(grow_past_inline_capacity)
|
||||
{
|
||||
auto make_vector = [] {
|
||||
Vector<DeprecatedString, 16> strings;
|
||||
Vector<ByteString, 16> strings;
|
||||
for (int i = 0; i < 32; ++i) {
|
||||
strings.append(DeprecatedString::number(i));
|
||||
strings.append(ByteString::number(i));
|
||||
}
|
||||
return strings;
|
||||
};
|
||||
|
@ -284,7 +284,7 @@ TEST_CASE(remove_all_matching)
|
|||
TEST_CASE(nonnullownptrvector)
|
||||
{
|
||||
struct Object {
|
||||
DeprecatedString string;
|
||||
ByteString string;
|
||||
};
|
||||
Vector<NonnullOwnPtr<Object>> objects;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue