mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:57:44 +00:00
Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
This commit is contained in:
parent
e5f09ea170
commit
3f3f45580a
762 changed files with 8315 additions and 8316 deletions
|
@ -196,14 +196,14 @@ Optional<MemoryRegionInfo> Reader::region_containing(FlatPtr address) const
|
|||
int Reader::process_pid() const
|
||||
{
|
||||
auto process_info = this->process_info();
|
||||
auto pid = process_info.get("pid");
|
||||
auto pid = process_info.get("pid"sv);
|
||||
return pid.to_number<int>();
|
||||
}
|
||||
|
||||
u8 Reader::process_termination_signal() const
|
||||
{
|
||||
auto process_info = this->process_info();
|
||||
auto termination_signal = process_info.get("termination_signal");
|
||||
auto termination_signal = process_info.get("termination_signal"sv);
|
||||
auto signal_number = termination_signal.to_number<u8>();
|
||||
if (signal_number <= SIGINVAL || signal_number >= NSIG)
|
||||
return SIGINVAL;
|
||||
|
@ -213,14 +213,14 @@ u8 Reader::process_termination_signal() const
|
|||
String Reader::process_executable_path() const
|
||||
{
|
||||
auto process_info = this->process_info();
|
||||
auto executable_path = process_info.get("executable_path");
|
||||
auto executable_path = process_info.get("executable_path"sv);
|
||||
return executable_path.as_string_or({});
|
||||
}
|
||||
|
||||
Vector<String> Reader::process_arguments() const
|
||||
{
|
||||
auto process_info = this->process_info();
|
||||
auto arguments = process_info.get("arguments");
|
||||
auto arguments = process_info.get("arguments"sv);
|
||||
if (!arguments.is_array())
|
||||
return {};
|
||||
Vector<String> vector;
|
||||
|
@ -234,7 +234,7 @@ Vector<String> Reader::process_arguments() const
|
|||
Vector<String> Reader::process_environment() const
|
||||
{
|
||||
auto process_info = this->process_info();
|
||||
auto environment = process_info.get("environment");
|
||||
auto environment = process_info.get("environment"sv);
|
||||
if (!environment.is_array())
|
||||
return {};
|
||||
Vector<String> vector;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue