diff options
author | Shannon Booth <shannon.ml.booth@gmail.com> | 2020-03-22 11:32:52 +1300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-22 01:15:33 +0100 |
commit | 1ef3d4af694ad21f765103e080b904540ababb02 (patch) | |
tree | a7be4bcd53bb9d5713a417d53f8c4e92dcf699ec /Shell | |
parent | d806dfe801bb47ed62b50501ce8b5954d4baded8 (diff) | |
download | serenity-1ef3d4af694ad21f765103e080b904540ababb02.zip |
Shell: Use starts_with() in expand_parameters
This reads a little nicer, and makes us care less about an empty String
Diffstat (limited to 'Shell')
-rw-r--r-- | Shell/main.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Shell/main.cpp b/Shell/main.cpp index cf7f330666..9dda6b4a37 100644 --- a/Shell/main.cpp +++ b/Shell/main.cpp @@ -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)); |