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

Re: [PATCH 1/2] strbuf: Use _rtrim and _ltrim in strbuf_trim

From
Jeff King <peff@peff.net>
Date
Apr 30, 2014, 17:11 UTC
Message-ID
<20140430171105.GA8518@sigill.intra.peff.net>
In-Reply-To
<1398848287-77109-1-git-send-email-modocache@gmail.com>
On Wed, Apr 30, 2014 at 05:58:06PM +0900, Brian Gesiak wrote:
Show 6 quoted lines
> strbuf_trim strips whitespace from the end, then the beginning of a
> strbuf. Those operations are duplicated in strbuf_rtrim and
> strbuf_ltrim.
> 
> Replace strbuf_trim implementation with calls to strbuf_rtrim,
> then strbuf_ltrim.

Thanks, this looks good. I wondered if perhaps doing them together inline might have been more efficient, but there really is no overlap in what they compute.

The documentation patch looks good to me, too.
-Peff
Previous: Brian Gesiak
Message 3 of 3 in “strbuf: Use _rtrim and _ltrim in strbuf_trim”
  1. 1/2 strbuf: Use _rtrim and _ltrim in strbuf_trimBrian Gesiak, Apr 30, 2014
  2. 2/2 api-strbuf.txt: Add docs for _trim and _ltrimBrian Gesiak, Apr 30, 2014
  3. Jeff KingApr 30, 2014

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.