graph: reuse `find_new_column_by_commit()`
authorJames Coglan <jcoglan@gmail.com>
Tue, 15 Oct 2019 23:47:49 +0000 (23:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Oct 2019 02:11:24 +0000 (11:11 +0900)
commit9157a2a032c4c5a154782537b6f1e2f8b7bd7435
treed11a3342bcca8d641e04653b53af528ef1929650
parent210179a20d585f6a96e0963db69790e590bd9433
graph: reuse `find_new_column_by_commit()`

I will shortly be making some changes to
`graph_insert_into_new_columns()` and so am trying to simplify it. One
possible simplification is that we can extract the loop for finding the
element in `new_columns` containing the given commit.

`find_new_column_by_commit()` contains a very similar loop but it
returns a `struct column *` rather than an `int` offset into the array.
Here I'm introducing a version that returns `int` and using that in
`graph_insert_into_new_columns()` and `graph_output_post_merge_line()`.

Signed-off-by: James Coglan <jcoglan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
graph.c