mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-27 20:25:12 +00:00
lint: Use early exit/continue
This commit is contained in:
parent
4fe2a2921f
commit
225caa2fe8
1 changed files with 34 additions and 33 deletions
|
@ -270,45 +270,46 @@ static void print_profile(const std::vector<profile_item_t *> &items, FILE *out)
|
||||||
int my_time;
|
int my_time;
|
||||||
|
|
||||||
me = items.at(pos);
|
me = items.at(pos);
|
||||||
if (!me->skipped) {
|
if (me->skipped) {
|
||||||
my_time = me->parse + me->exec;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = pos + 1; i < items.size(); i++) {
|
my_time = me->parse + me->exec;
|
||||||
prev = items.at(i);
|
for (i = pos + 1; i < items.size(); i++) {
|
||||||
if (prev->skipped) {
|
prev = items.at(i);
|
||||||
continue;
|
if (prev->skipped) {
|
||||||
}
|
continue;
|
||||||
|
}
|
||||||
if (prev->level <= me->level) {
|
if (prev->level <= me->level) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (prev->level > me->level + 1) {
|
||||||
if (prev->level > me->level + 1) {
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
my_time -= prev->parse;
|
|
||||||
my_time -= prev->exec;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me->cmd.size() > 0) {
|
my_time -= prev->parse + prev->exec;
|
||||||
if (fwprintf(out, L"%d\t%d\t", my_time, me->parse + me->exec) < 0) {
|
}
|
||||||
wperror(L"fwprintf");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < me->level; i++) {
|
if (me->cmd.size() == 0) {
|
||||||
if (fwprintf(out, L"-") < 0) {
|
continue;
|
||||||
wperror(L"fwprintf");
|
}
|
||||||
return;
|
|
||||||
}
|
if (fwprintf(out, L"%d\t%d\t", my_time, me->parse + me->exec) < 0) {
|
||||||
}
|
wperror(L"fwprintf");
|
||||||
if (fwprintf(out, L"> %ls\n", me->cmd.c_str()) < 0) {
|
return;
|
||||||
wperror(L"fwprintf");
|
}
|
||||||
return;
|
|
||||||
}
|
for (i = 0; i < me->level; i++) {
|
||||||
|
if (fwprintf(out, L"-") < 0) {
|
||||||
|
wperror(L"fwprintf");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fwprintf(out, L"> %ls\n", me->cmd.c_str()) < 0) {
|
||||||
|
wperror(L"fwprintf");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue