mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 00:47:45 +00:00
AK: Remove StringBuilder::build() in favor of to_deprecated_string()
Having an alias function that only wraps another one is silly, and keeping the more obvious name should flush out more uses of deprecated strings. No behavior change.
This commit is contained in:
parent
da81041e97
commit
6e7459322d
129 changed files with 213 additions and 219 deletions
|
@ -48,7 +48,7 @@ static ErrorOr<DeprecatedString> sem_name_to_path(char const* name)
|
|||
StringBuilder builder;
|
||||
TRY(builder.try_append(sem_path_prefix));
|
||||
TRY(builder.try_append(name_view));
|
||||
return builder.build();
|
||||
return builder.to_deprecated_string();
|
||||
}
|
||||
|
||||
struct NamedSemaphore {
|
||||
|
|
|
@ -641,7 +641,7 @@ int ptsname_r(int fd, char* buffer, size_t size)
|
|||
return -1;
|
||||
}
|
||||
memset(buffer, 0, devpts_path_builder.length() + 1);
|
||||
auto full_devpts_path_string = devpts_path_builder.build();
|
||||
auto full_devpts_path_string = devpts_path_builder.to_deprecated_string();
|
||||
if (!full_devpts_path_string.copy_characters_to_buffer(buffer, size)) {
|
||||
errno = ERANGE;
|
||||
return -1;
|
||||
|
|
|
@ -124,7 +124,7 @@ void vsyslog_r(int priority, struct syslog_data* data, char const* message, va_l
|
|||
combined.appendff("{}: ", get_syslog_ident(data));
|
||||
|
||||
combined.appendvf(message, args);
|
||||
DeprecatedString combined_string = combined.build();
|
||||
auto combined_string = combined.to_deprecated_string();
|
||||
|
||||
if (data->logopt & LOG_CONS)
|
||||
dbgputstr(combined_string.characters(), combined_string.length());
|
||||
|
|
|
@ -390,7 +390,7 @@ size_t strftime(char* destination, size_t max_size, char const* format, const st
|
|||
return 0;
|
||||
}
|
||||
|
||||
auto str = builder.build();
|
||||
auto str = builder.to_deprecated_string();
|
||||
bool fits = str.copy_characters_to_buffer(destination, max_size);
|
||||
return fits ? str.length() : 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue