Commit 809ea28
commit-graph: split out function to search commit position
The function `find_commit_in_graph()` assumes that the caller has passed
an object which was already determined to be a commit given that it will
access the commit's graph position, which is stored in a commit slab. In
a subsequent patch, we want to search for an object ID though without
knowing whether it is a commit or not, which is not currently possible.
Split out the logic to search the commit graph for a given object ID to
prepare for this change. This commit also renames the function to
`find_commit_pos_in_graph()`, which more accurately reflects what this
function does. Furthermore, in order to allow for the searched object ID
to be const, we need to adjust `bsearch_graph()`'s signature to accept a
constant object ID as input, too.
Signed-off-by: Patrick Steinhardt <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent bf9c0cb commit 809ea28
1 file changed
+30
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
726 | | - | |
| 726 | + | |
727 | 727 | | |
728 | 728 | | |
729 | 729 | | |
| |||
864 | 864 | | |
865 | 865 | | |
866 | 866 | | |
867 | | - | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
868 | 884 | | |
869 | 885 | | |
870 | 886 | | |
871 | 887 | | |
872 | 888 | | |
873 | 889 | | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
| 890 | + | |
886 | 891 | | |
887 | 892 | | |
888 | 893 | | |
| |||
895 | 900 | | |
896 | 901 | | |
897 | 902 | | |
898 | | - | |
| 903 | + | |
899 | 904 | | |
900 | 905 | | |
901 | 906 | | |
| |||
921 | 926 | | |
922 | 927 | | |
923 | 928 | | |
924 | | - | |
| 929 | + | |
925 | 930 | | |
926 | 931 | | |
927 | 932 | | |
| |||
1091 | 1096 | | |
1092 | 1097 | | |
1093 | 1098 | | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
1097 | 1102 | | |
1098 | 1103 | | |
1099 | 1104 | | |
| |||
1122 | 1127 | | |
1123 | 1128 | | |
1124 | 1129 | | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
1128 | 1133 | | |
1129 | 1134 | | |
1130 | 1135 | | |
| |||
1235 | 1240 | | |
1236 | 1241 | | |
1237 | 1242 | | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
1241 | 1246 | | |
1242 | 1247 | | |
1243 | 1248 | | |
| |||
0 commit comments