Browse Source

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>
maint
Johannes Schindelin 5 years ago committed by Junio C Hamano
parent
commit
e3f53ce5bd
  1. 3
      Documentation/MyFirstObjectWalk.txt

3
Documentation/MyFirstObjectWalk.txt

@ -357,9 +357,6 @@ static void walken_commit_walk(struct rev_info *rev) @@ -357,9 +357,6 @@ static void walken_commit_walk(struct rev_info *rev)
...

while ((commit = get_revision(rev))) {
if (!commit)
continue;

strbuf_reset(&prettybuf);
pp_commit_easy(CMIT_FMT_ONELINE, commit, &prettybuf);
puts(prettybuf.buf);

Loading…
Cancel
Save