From 1ef3d4af694ad21f765103e080b904540ababb02 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sun, 22 Mar 2020 11:32:52 +1300 Subject: [PATCH] Shell: Use starts_with() in expand_parameters This reads a little nicer, and makes us care less about an empty String --- Shell/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 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 expand_globs(const StringView& path, const StringView& bas static Vector 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));