Skip to content

Commit afb32e8

Browse files
keyu98gitster
authored andcommitted
pack-revindex.h: correct the time complexity descriptions
Time complexities for pack_pos_to_midx and midx_to_pack_pos are swapped, correct it. Signed-off-by: Kyle Zhao <[email protected]> Reviewed-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e6b971f commit afb32e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pack-revindex.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ off_t pack_pos_to_offset(struct packed_git *p, uint32_t pos);
109109
* If the reverse index has not yet been loaded, or the position is out of
110110
* bounds, this function aborts.
111111
*
112-
* This function runs in time O(log N) with the number of objects in the MIDX.
112+
* This function runs in constant time.
113113
*/
114114
uint32_t pack_pos_to_midx(struct multi_pack_index *m, uint32_t pos);
115115

@@ -120,7 +120,7 @@ uint32_t pack_pos_to_midx(struct multi_pack_index *m, uint32_t pos);
120120
* If the reverse index has not yet been loaded, or the position is out of
121121
* bounds, this function aborts.
122122
*
123-
* This function runs in constant time.
123+
* This function runs in time O(log N) with the number of objects in the MIDX.
124124
*/
125125
int midx_to_pack_pos(struct multi_pack_index *midx, uint32_t at, uint32_t *pos);
126126

0 commit comments

Comments
 (0)