r/badcode • • Sep 13 '20

c Found in git's bisect algorithm

Post image
744 Upvotes

17 comments sorted by

View all comments

20

u/MurdoMaclachlan public boolean isInt(int i) { return true; } Sep 14 '20

Image Transcription: Code


/*
 * This is a truly stupid algorithm, but it's only
 * used for bisection, and we just don't care enough.
 *
 * We care just barely enough to avoid recursing for
 * non-merge entries.
 */
static int count_distance(struct commit_list *entry)

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

7

u/aharmonicminor sadistic Sep 14 '20

good human :)