1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +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:
Ali Mohammad Pur 2023-12-16 17:49:34 +03:30 committed by Ali Mohammad Pur
parent 38d62563b3
commit 5e1499d104
1615 changed files with 10257 additions and 10257 deletions

View file

@ -40,19 +40,19 @@ void TreeNode::sort_children_by_area() const
}
struct QueueEntry {
QueueEntry(DeprecatedString path, TreeNode* node)
QueueEntry(ByteString path, TreeNode* node)
: path(move(path))
, node(node) {};
DeprecatedString path;
ByteString path;
TreeNode* node { nullptr };
};
static MountInfo* find_mount_for_path(DeprecatedString path, Vector<MountInfo>& mounts)
static MountInfo* find_mount_for_path(ByteString path, Vector<MountInfo>& mounts)
{
MountInfo* result = nullptr;
size_t length = 0;
for (auto& mount_info : mounts) {
DeprecatedString& mount_point = mount_info.mount_point;
ByteString& mount_point = mount_info.mount_point;
if (path.starts_with(mount_point)) {
if (!result || mount_point.length() > length) {
result = &mount_info;
@ -81,7 +81,7 @@ HashMap<int, int> TreeNode::populate_filesize_tree(Vector<MountInfo>& mounts, Fu
StringBuilder builder = StringBuilder();
builder.append(m_name);
builder.append('/');
MountInfo* root_mount_info = find_mount_for_path(builder.to_deprecated_string(), mounts);
MountInfo* root_mount_info = find_mount_for_path(builder.to_byte_string(), mounts);
if (!root_mount_info) {
return error_accumulator;
}
@ -92,7 +92,7 @@ HashMap<int, int> TreeNode::populate_filesize_tree(Vector<MountInfo>& mounts, Fu
builder.append(queue_entry.path);
builder.append('/');
MountInfo* mount_info = find_mount_for_path(builder.to_deprecated_string(), mounts);
MountInfo* mount_info = find_mount_for_path(builder.to_byte_string(), mounts);
if (!mount_info || (mount_info != root_mount_info && mount_info->source != root_mount_info->source)) {
continue;
}
@ -123,7 +123,7 @@ HashMap<int, int> TreeNode::populate_filesize_tree(Vector<MountInfo>& mounts, Fu
} else {
auto st = st_or_error.release_value();
if (S_ISDIR(st.st_mode)) {
queue.enqueue(QueueEntry(builder.to_deprecated_string(), &child));
queue.enqueue(QueueEntry(builder.to_byte_string(), &child));
} else {
child.m_area = st.st_size;
}
@ -137,7 +137,7 @@ HashMap<int, int> TreeNode::populate_filesize_tree(Vector<MountInfo>& mounts, Fu
return error_accumulator;
}
Optional<TreeNode const&> TreeNode::child_with_name(DeprecatedString name) const
Optional<TreeNode const&> TreeNode::child_with_name(ByteString name) const
{
for (auto& child : *m_children) {
if (child.name() == name)