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

Re: [PATCH v3] mru: Replace mru.[ch] with list.h implementation

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jan 20, 2018, 00:59 UTC
Message-ID
<CAPig+cQ9mMVvMLKSQOKxinc5iuRK61yTDQ511ZdNqEOtbCGoAQ@mail.gmail.com>
In-Reply-To
<1516404987-3420-1-git-send-email-gs051095@gmail.com>
On Fri, Jan 19, 2018 at 6:36 PM, Gargi Sharma <gs051095@gmail.com> wrote:
> Replace the custom calls to mru.[ch] with calls to list.h. This patch is
> the final step in removing the mru API completely and inlining the logic.
> This patch leads to significant code reduction and the mru API hence, is
> not a useful abstraction anymore.
A couple minor style nits below... (may not be worth a re-roll)
Show 14 quoted lines
> Signed-off-by: Gargi Sharma <gs051095@gmail.com>
> ---
> diff --git a/cache.h b/cache.h
> @@ -1587,10 +1588,10 @@ extern struct packed_git {
>  } *packed_git;
>
>  /*
> - * A most-recently-used ordered version of the packed_git list, which can
> - * be iterated instead of packed_git (and marked via mru_mark).
> + * A most-recently-used ordered version of the packed_git list.
>   */
> -extern struct mru packed_git_mru;
> +extern struct list_head packed_git_mru;
> +
Unnecessary extra blank line.
Show 13 quoted lines
>  struct pack_entry {
>         off_t offset;
> diff --git a/packfile.c b/packfile.c
> @@ -859,9 +859,9 @@ static void prepare_packed_git_mru(void)
>  {
>         struct packed_git *p;
>
> -       mru_clear(&packed_git_mru);
> -       for (p = packed_git; p; p = p->next)
> -               mru_append(&packed_git_mru, p);
> +       for (p = packed_git; p; p = p->next) {
> +               list_add_tail(&p->mru, &packed_git_mru);
> +       }
Unnecessary braces on for-loop.
>  }
Previous: Gargi SharmaNext: Gargi Sharma
Message 2 of 7 in “mru: Replace mru.[ch] with list.h implementation”
  1. mru: Replace mru.[ch] with list.h implementationGargi Sharma, Jan 19, 2018
  2. Eric SunshineJan 20, 2018
  3. Gargi SharmaJan 20, 2018
  4. Eric WongJan 20, 2018
  5. Gargi SharmaJan 20, 2018
  6. René ScharfeJan 21, 2018
  7. Gargi SharmaJan 21, 2018

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.