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

Re: ordered string-list considered harmful, was Re: [PATCH v3] Allow aliases that include other aliases

From
Jeff King <peff@peff.net>
Date
Sep 7, 2018, 14:48 UTC
Message-ID
<20180907144802.GA26719@sigill.intra.peff.net>
In-Reply-To
<20180907063241.GA172953@aiede.svl.corp.google.com>
On Thu, Sep 06, 2018 at 11:32:41PM -0700, Jonathan Nieder wrote:
Show 8 quoted lines
> > I think Stefan pointed out a "case 4" in the other part of the thread:
> > ones where we really care not just about fast lookup, but actual
> > iteration order.
> 
> I had assumed that that was the whole point of this data structure.
> Anything else that is using it for lookups should indeed use a hash
> map instead, and I can take my share of blame for missing this kind of
> thing in review.

Keep in mind we didn't have a decent generic hashmap for many years. So I think string-list got used in its place.

Show 10 quoted lines
> > I think I like the hashmap way, if the conversion isn't too painful.
> 
> If we don't have any callers that actually need the sort-and-lookup
> thing, then yay, let's get rid of it.  But I don't actually think of
> this as the hashmap way.  It's the get-rid-of-the-unneeded-feature
> way.
> 
> In other words, *regardless* of what else we should do, we should
> update any callers that want a hashmap to use a hashmap.  Please go
> ahead, even if it doesn't let us simplify the string list API at all.
Great, I think we're on the same page. Thanks!
-Peff
Previous: brian m. carlsonNext: Stefan Beller
Message 9 of 13 in “ordered string-list considered harmful, was Re: [PATCH v3] Allow aliases that include other aliases”
  1. Jeff KingSep 6, 2018
  2. Jeff KingSep 6, 2018
  3. Jonathan NiederSep 6, 2018
  4. Jeff KingSep 7, 2018
  5. Jonathan NiederSep 7, 2018
  6. Ævar Arnfjörð BjarmasonSep 7, 2018
  7. Jonathan NiederSep 7, 2018
  8. brian m. carlsonSep 8, 2018
  9. Jeff KingSep 7, 2018
  10. Stefan BellerSep 6, 2018
  11. Jeff KingSep 6, 2018
  12. Stefan BellerSep 6, 2018
  13. Jeff KingSep 7, 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.