Skip to content

Commit

Permalink
tidy: Clean up control flow jumps followed by else statements. (filters)
Browse files Browse the repository at this point in the history
If the last statement in an "if" block unconditional changes the
control flow, then there is no need to follow that statement with an
else block.  Omitting the "else" statement and the indentation of the
subsequent block makes the code easier to follow.

https://clang.llvm.org/extra/clang-tidy/checks/readability-else-after-return.html
  • Loading branch information
linuxdude42 committed Mar 19, 2019
1 parent 97c5262 commit 2475fdb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mythtv/filters/ivtc/pullup.c
Expand Up @@ -596,7 +596,7 @@ static int decide_frame_length(struct pullup_context *c)
&& (f0->affinity != 1 || f1->affinity != -1) )
return 1;
if (f1->affinity == 1) return 1;
else return 2;
return 2;
case 3:
if (f2->affinity == 1) return 2;
else return 3;
Expand All @@ -606,7 +606,7 @@ static int decide_frame_length(struct pullup_context *c)
else if (f1->affinity == -1) return 2; /* covers 6 */
else if (f2->affinity == -1) { /* covers 2 */
if (f0->affinity == 1) return 3;
else return 1;
return 1;
}
else return 2; /* the remaining 6 */
}
Expand Down
5 changes: 2 additions & 3 deletions mythtv/filters/vflip/filter_vflip.c
Expand Up @@ -57,10 +57,9 @@ static int comp(const void *va, const void *vb)
int *b = (int *) vb;
if (*a == *b)
return 0;
else if (*a < *b)
if (*a < *b)
return -1;
else
return 1;
return 1;
}

static int vflip(VideoFilter *vf, VideoFrame *frame, int field)
Expand Down

0 comments on commit 2475fdb

Please sign in to comment.