Skip to content

Commit e3f53ce

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Reviewed-by: Emily Shaffer <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3bab5d5 commit e3f53ce

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

Documentation/MyFirstObjectWalk.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,6 @@ static void walken_commit_walk(struct rev_info *rev)
357357
...
358358

359359
while ((commit = get_revision(rev))) {
360-
if (!commit)
361-
continue;
362-
363360
strbuf_reset(&prettybuf);
364361
pp_commit_easy(CMIT_FMT_ONELINE, commit, &prettybuf);
365362
puts(prettybuf.buf);

0 commit comments

Comments
 (0)