mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 10:26:31 +00:00
vim-patch:partial:9.0.1196: code is indented more than necessary (#21796)
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes vim/vim#11813)
e857598896
Partial port as this depends on some previous eval and 'smoothscroll'
patches.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -1377,17 +1377,19 @@ char *make_percent_swname(const char *dir, const char *name)
|
||||
{
|
||||
char *d = NULL;
|
||||
char *f = fix_fname(name != NULL ? name : "");
|
||||
if (f != NULL) {
|
||||
char *s = xstrdup(f);
|
||||
for (d = s; *d != NUL; MB_PTR_ADV(d)) {
|
||||
if (vim_ispathsep(*d)) {
|
||||
*d = '%';
|
||||
}
|
||||
}
|
||||
d = concat_fnames(dir, s, true);
|
||||
xfree(s);
|
||||
xfree(f);
|
||||
if (f == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *s = xstrdup(f);
|
||||
for (d = s; *d != NUL; MB_PTR_ADV(d)) {
|
||||
if (vim_ispathsep(*d)) {
|
||||
*d = '%';
|
||||
}
|
||||
}
|
||||
d = concat_fnames(dir, s, true);
|
||||
xfree(s);
|
||||
xfree(f);
|
||||
return d;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user