]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pack-revindex.h: correct the time complexity descriptions
authorKyle Zhao <kylezhao@tencent.com>
Wed, 15 Sep 2021 09:09:23 +0000 (09:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Sep 2021 05:16:25 +0000 (22:16 -0700)
Time complexities for pack_pos_to_midx and midx_to_pack_pos are swapped,
correct it.

Signed-off-by: Kyle Zhao <kylezhao@tencent.com>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-revindex.h

index 479b8f2f9c916880ee692ea812b689d0237c18b1..74f4eae668d5555f99fa4d6af0f486ddc94b5447 100644 (file)
@@ -109,7 +109,7 @@ off_t pack_pos_to_offset(struct packed_git *p, uint32_t pos);
  * If the reverse index has not yet been loaded, or the position is out of
  * bounds, this function aborts.
  *
- * This function runs in time O(log N) with the number of objects in the MIDX.
+ * This function runs in constant time.
  */
 uint32_t pack_pos_to_midx(struct multi_pack_index *m, uint32_t pos);
 
@@ -120,7 +120,7 @@ uint32_t pack_pos_to_midx(struct multi_pack_index *m, uint32_t pos);
  * If the reverse index has not yet been loaded, or the position is out of
  * bounds, this function aborts.
  *
- * This function runs in constant time.
+ * This function runs in time O(log N) with the number of objects in the MIDX.
  */
 int midx_to_pack_pos(struct multi_pack_index *midx, uint32_t at, uint32_t *pos);