mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-24 02:05:30 +08:00
builtin_string: remove redundant statements
This commit is contained in:
parent
efe94344e2
commit
52b0d356ff
|
@ -1287,7 +1287,7 @@ static int string_pad(parser_t &parser, io_streams_t &streams, int argc, wchar_t
|
|||
|
||||
arg_iterator_t aiter(argv, optind, streams);
|
||||
while (const wcstring *arg = aiter.nextstr()) {
|
||||
wcstring padded = wcstring(*arg);
|
||||
wcstring padded = *arg;
|
||||
size_t pad_left = 0;
|
||||
size_t pad_right = 0;
|
||||
|
||||
|
@ -1315,13 +1315,8 @@ static int string_pad(parser_t &parser, io_streams_t &streams, int argc, wchar_t
|
|||
}
|
||||
}
|
||||
|
||||
if (pad_left) {
|
||||
padded.insert(0, pad_left, opts.char_to_pad);
|
||||
}
|
||||
|
||||
if (pad_right) {
|
||||
padded.append(pad_right, opts.char_to_pad);
|
||||
}
|
||||
padded.insert(0, pad_left, opts.char_to_pad);
|
||||
padded.append(pad_right, opts.char_to_pad);
|
||||
|
||||
npad += padded.size();
|
||||
if (!opts.quiet) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user