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

Re: [PATCH v3 2/2] Rename suffixcmp() to has_suffix() and invert its result

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 7, 2013, 00:12 UTC
Message-ID
<xmqq38n96pdo.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20131106221735.GB10302@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 6 quoted lines
>> The old name followed the pattern anything-cmp(), which suggests
>> a general comparison function suitable for e.g. sorting objects.
>> But this was not the case for suffixcmp().
>
> It's not clear to me that prefixcmp() is usable for sorting objects,
> either.  Shouldn't it get the same treatment?
Sounds like a plan for a good follow-up series.
Show 5 quoted lines
> If some day we invent a type for 4-byte-aligned object names, it might
> make sense to do something similar to hashcmp, distinguishing between
> hashcmp for use where ordering is important and something like hash_eq
> when checking for equality (since I suspect the latter can be made
> faster).
Interesting.
Previous: Max HornNext: Christian Couder
Message 6 of 7 in “Rename suffixcmp() to has_suffix() and invert its result”
  1. 2/2 Rename suffixcmp() to has_suffix() and invert its resultChristian Couder, Nov 5, 2013
  2. Jonathan NiederNov 6, 2013
  3. Max HornNov 6, 2013
  4. Jonathan NiederNov 6, 2013
  5. Max HornNov 6, 2013
  6. Junio C HamanoNov 7, 2013
  7. Christian CouderNov 7, 2013

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.