btrfs-progs: subvol list: remove ugly goto construct

Jumping into an if is not considered nice.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-10-31 12:46:52 +01:00
parent f4ea2ec981
commit fc82ce45dc
1 changed files with 2 additions and 4 deletions

View File

@ -277,7 +277,7 @@ static int sort_comp(struct root_info *entry1, struct root_info *entry2,
int i, ret = 0;
if (!set || !set->ncomps)
goto comp_rootid;
return comp_entry_with_rootid(entry1, entry2, 0);
for (i = 0; i < set->ncomps; i++) {
if (!set->comps[i].comp_func)
@ -292,10 +292,8 @@ static int sort_comp(struct root_info *entry1, struct root_info *entry2,
rootid_compared = 1;
}
if (!rootid_compared) {
comp_rootid:
if (!rootid_compared)
ret = comp_entry_with_rootid(entry1, entry2, 0);
}
return ret;
}