Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

Re: [PATCH] sequencer: trivial cleanup

From: Ramkumar Ramachandra <hidden>
Date: 2016-06-15 22:58:41

Felipe Contreras wrote:
quoted
 sequencer.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 351548f..8ed9f98 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -466,10 +466,7 @@ static int allow_empty(struct replay_opts *opts, struct commit *commit)
        empty_commit = is_original_commit_empty(commit);
        if (empty_commit < 0)
                return empty_commit;
-       if (!empty_commit)
-               return 0;
-       else
-               return 1;
+       return empty_commit ? 0 : 1;
 }
Isn't it the other way around? Moreover, 'return !!empty_commit;'
would be simpler.
Yeah, thanks for pointing out this grave stupidity. This seems to be
inconsequential as far as the tests are concerned: have to do some
major yak shaving.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help