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
Max Horn <max@quendi.de>
Date
Nov 6, 2013, 23:53 UTC
Message-ID
<11C89E15-B6DE-4FE4-9135-0841CFAE92A4@quendi.de>
In-Reply-To
<20131106232805.GD10302@google.com>
Show 10 quoted lines
> Am 07.11.2013 um 00:28 schrieb Jonathan Nieder <jrnieder@gmail.com>:
> 
> Max Horn wrote:
> 
>> Well, unlike suffixcmp, it is transitive, so it could be used for sorting.
> 
> It is not antisymmetric.
> 
>    prefixcmp("foo", "foobar") < 0
>    prefixcmp("foobar", "foo") == 0
Right! I wasn't thinkinh :-(
> 
> I can see how it's possible to care about the sign of the return
> value, but it's equally possible to care about the sign from
> suffixcmp.  Neither is suitable as a function for passing to qsort.
Yeah, so then I'd be for changing rhis one to has_prefix.
> 
> Hoping that clarifies,
> Jonathan
> 
Previous: Jonathan NiederNext: Junio C Hamano
Message 5 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.