From c3fa8c04bf8fea18561ff602640581525461f1f2 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 25 Nov 2019 16:34:06 -0800 Subject: [PATCH] [clang-tidy] Don't empty initialize strings Found with readability-redundant-string-init Signed-off-by: Rosen Penev --- src/fish_indent.cpp | 2 +- src/wildcard.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fish_indent.cpp b/src/fish_indent.cpp index 0444f97b3..bb7cb185d 100644 --- a/src/fish_indent.cpp +++ b/src/fish_indent.cpp @@ -137,7 +137,7 @@ struct prettifier_t { static void dump_node(indent_t node_indent, const parse_node_t &node, const wcstring &source) { wchar_t nextc = L' '; wchar_t prevc = L' '; - wcstring source_txt = L""; + wcstring source_txt; if (node.source_start != SOURCE_OFFSET_INVALID && node.source_length != SOURCE_OFFSET_INVALID) { int nextc_idx = node.source_start + node.source_length; if (static_cast(nextc_idx) < source.size()) { diff --git a/src/wildcard.cpp b/src/wildcard.cpp index 58b8c00e7..952fb42e0 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -927,7 +927,7 @@ int wildcard_expand_string(const wcstring &wc, const wcstring &working_directory // Check for a leading slash. If we find one, we have an absolute path: the prefix is empty, the // base dir is /, and the wildcard is the remainder. If we don't find one, the prefix is the // working directory, the base dir is empty. - wcstring prefix = L"", base_dir = L"", effective_wc; + wcstring prefix, base_dir, effective_wc; if (string_prefixes_string(L"/", wc)) { base_dir = L"/"; effective_wc = wc.substr(1);