mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-22 10:28:39 +08:00
[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:
parent
87e24db5ef
commit
c3fa8c04bf
@ -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()) {
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user