mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +00:00
Shell: Use starts_with() in expand_parameters
This reads a little nicer, and makes us care less about an empty String
This commit is contained in:
committed by
Andreas Kling
parent
d806dfe801
commit
1ef3d4af69
@@ -700,8 +700,7 @@ static Vector<String> expand_globs(const StringView& path, const StringView& bas
|
||||
|
||||
static Vector<String> expand_parameters(const StringView& param)
|
||||
{
|
||||
bool is_variable = param.length() > 1 && param[0] == '$';
|
||||
if (!is_variable)
|
||||
if (!param.starts_with('$'))
|
||||
return { param };
|
||||
|
||||
String variable_name = String(param.substring_view(1, param.length() - 1));
|
||||
|
||||
Reference in New Issue
Block a user