mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
@@ -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) };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user