mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 15:38:12 +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:
parent
d806dfe801
commit
1ef3d4af69
1 changed files with 1 additions and 2 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue