@matheusbsbs / matheus-bagliano / commits / e3f53ce5bd
Fork 0

MyFirstObjectWalk: remove unnecessary conditional statement

In the given example, `commit` cannot be `NULL` (because this is the loop condition: if it was `NULL`, the loop body would not be entered at all). It took this developer a moment or two to see that this is therefore dead code. Let's remove it, to avoid puzzling future readers. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Mar 28, 2020 at 15:19 UTC e3f53ce5bddc9bc58de32ec435a8695000ad9fe6
1 file changed -3
Documentation/MyFirstObjectWalk.txt
-3
@@ -357,9 +357,6 @@ static void walken_commit_walk(struct rev_info *rev)
357 ...
358
359 while ((commit = get_revision(rev))) {
360 - if (!commit)
361 - continue;
362 -
360 strbuf_reset(&prettybuf);
361 pp_commit_easy(CMIT_FMT_ONELINE, commit, &prettybuf);
362 puts(prettybuf.buf);