git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] pack-revindex.h: correct the time complexity descriptions

From
Bagas Sanjaya <bagasdotme@gmail.com>
Date
Sep 15, 2021, 09:12 UTC
Message-ID
<67cfff14-8158-6401-b0f2-1f6de37c5815@gmail.com>
In-Reply-To
<pull.1039.v2.git.1631696964072.gitgitgadget@gmail.com>
On 15/09/21 16.09, Kyle Zhao via GitGitGadget wrote:
Show 7 quoted lines
> From: kylezhao <kylezhao@tencent.com>
> 
> Time complexities for pack_pos_to_midx and midx_to_pack_pos are swapped,
> correct it.
> 
> Signed-off-by: kylezhao <kylezhao@tencent.com>
> ---
<snip>...
Show 28 quoted lines
>   pack-revindex.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/pack-revindex.h b/pack-revindex.h
> index 479b8f2f9c9..74f4eae668d 100644
> --- a/pack-revindex.h
> +++ b/pack-revindex.h
> @@ -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);
>   
> 
> base-commit: 8b7c11b8668b4e774f81a9f0b4c30144b818f1d1
> 
OK.
Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
-- 
An old man doll... just what I always wanted! - Clara
Previous: Kyle Zhao via GitGitGadgetNext: Taylor Blau
Message 4 of 6 in “pack-revindex.h: fix typos of time complexity”
  1. pack-revindex.h: fix typos of time complexityKyle Zhao via GitGitGadget, Sep 15, 2021
  2. Bagas SanjayaSep 15, 2021
  3. pack-revindex.h: correct the time complexity descriptionsKyle Zhao via GitGitGadget, Sep 15, 2021
  4. Bagas SanjayaSep 15, 2021
  5. Taylor BlauSep 16, 2021
  6. Junio C HamanoSep 16, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.