From e3f53ce5bddc9bc58de32ec435a8695000ad9fe6 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 28 Mar 2020 15:19:13 +0000 Subject: [PATCH] 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 Reviewed-by: Emily Shaffer Signed-off-by: Junio C Hamano --- Documentation/MyFirstObjectWalk.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt index aa828dfdc4..c3f2d1a831 100644 --- a/Documentation/MyFirstObjectWalk.txt +++ b/Documentation/MyFirstObjectWalk.txt @@ -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); -- 2.39.2