mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 22:52:22 +02:00
Userland: Prefer _string over _short_string
As `_string` can't fail anymore (since 3434412), there are no real
benefits to use the short variant in most cases.
This commit is contained in:
committed by
Andreas Kling
parent
a5edc9cdfc
commit
3f35ffb648
Notes:
sideshowbarker
2024-07-17 06:00:02 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/3f35ffb648 Pull-request: https://github.com/SerenityOS/serenity/pull/20418
@@ -1261,7 +1261,7 @@ ErrorOr<RefPtr<Value>> ForLoop::run(RefPtr<Shell> shell)
|
||||
};
|
||||
|
||||
if (m_iterated_expression) {
|
||||
auto variable_name = m_variable.has_value() ? m_variable->name : "it"_short_string;
|
||||
auto variable_name = m_variable.has_value() ? m_variable->name : "it"_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> {
|
||||
@@ -3895,9 +3895,9 @@ 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 { "1"_short_string }, m_slices) };
|
||||
return { resolve_slices(shell, Vector { "1"_string }, m_slices) };
|
||||
}
|
||||
return { resolve_slices(shell, Vector { "0"_short_string }, m_slices) };
|
||||
return { resolve_slices(shell, Vector { "0"_string }, m_slices) };
|
||||
default:
|
||||
return { resolve_slices(shell, Vector { String {} }, m_slices) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user