1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

Everywhere: Use '_{short_,}string' literals more

This mostly updates code what was written before but merged after these
were added.
This commit is contained in:
Linus Groh 2023-02-28 13:50:29 +00:00
parent d0ba5f2ed7
commit 51c3967516
15 changed files with 94 additions and 95 deletions

View file

@ -1259,7 +1259,7 @@ ErrorOr<RefPtr<Value>> ForLoop::run(RefPtr<Shell> shell)
};
if (m_iterated_expression) {
auto variable_name = m_variable.has_value() ? m_variable->name : String::from_utf8_short_string("it"sv);
auto variable_name = m_variable.has_value() ? m_variable->name : "it"_short_string;
Optional<StringView> index_name = m_index_variable.has_value() ? Optional<StringView>(m_index_variable->name) : Optional<StringView>();
size_t i = 0;
TRY(m_iterated_expression->for_each_entry(shell, [&](auto value) -> ErrorOr<IterationDecision> {
@ -3877,11 +3877,11 @@ ErrorOr<Vector<String>> SpecialVariableValue::resolve_as_list(RefPtr<Shell> shel
auto list_argv = static_cast<AST::ListValue const*>(argv.ptr());
return { resolve_slices(shell, Vector { TRY(String::number(list_argv->values().size())) }, m_slices) };
}
return { resolve_slices(shell, Vector { String::from_utf8_short_string("1"sv) }, m_slices) };
return { resolve_slices(shell, Vector { "1"_short_string }, m_slices) };
}
return { resolve_slices(shell, Vector { String::from_utf8_short_string("0"sv) }, m_slices) };
return { resolve_slices(shell, Vector { "0"_short_string }, m_slices) };
default:
return { resolve_slices(shell, Vector { String::from_utf8_short_string(""sv) }, m_slices) };
return { resolve_slices(shell, Vector { String {} }, m_slices) };
}
}