[clang-tidy] Don't empty initialize strings

Found with readability-redundant-string-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2019-11-25 16:34:06 -08:00 committed by ridiculousfish
parent 87e24db5ef
commit c3fa8c04bf
2 changed files with 2 additions and 2 deletions

View File

@ -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<size_t>(nextc_idx) < source.size()) {

View File

@ -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);