From 4046b4cedf5c5045f7885c13825202d093fd999c Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 9 Sep 2021 18:35:19 +0200 Subject: [PATCH] Remove redundant variable normalize_path returns a wcstring, so the check can't fail. Just pass it directly. --- src/expand.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/expand.cpp b/src/expand.cpp index 37de2f2f0..4d0352579 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -834,11 +834,8 @@ static void expand_home_directory(wcstring &input, const environment_t &vars) { } } - maybe_t realhome; - if (home) realhome = normalize_path(*home); - - if (realhome) { - input.replace(input.begin(), input.begin() + tail_idx, *realhome); + if (home) { + input.replace(input.begin(), input.begin() + tail_idx, normalize_path(*home)); } else { input[0] = L'~'; }