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

Re: [JGIT PATCH 1/6] Add set to IntList

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 4, 2009, 15:10 UTC
Message-ID
<alpine.DEB.1.00.0905041709100.5553@intel-tinevez-2-302>
In-Reply-To
<20090504145506.GV23604@spearce.org>
Hi,
On Mon, 4 May 2009, Shawn O. Pearce wrote:
Show 19 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > On Mon, 4 May 2009, Shawn O. Pearce wrote:
> > 
> > > Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:
> > > > l?rdag 02 maj 2009 04:08:42 skrev "Shawn O. Pearce" 
> > > > <spearce@spearce.org>:
> > > > > Some applications may wish to modify an int list.
> > > 
> > > OK, as it turns out, this is used by code which Dscho wrote but I 
> > > haven't packaged up as patches yet.  And I don't think that even uses 
> > > the weird set(size(), ...) expands the list rules I implemented. So drop 
> > > this patch for now from the series and I'll respin it at a later date.
> > 
> > Indeed, my code only needs add(int i), which should expand the array on 
> > demand (i.e. after a clear(), it should _not_ blindly resize the array).
> 
> Really?  When I was starting to bring your code in and moved from 
> IntArray to IntList I had compile errors on set calls, so I added it to 
> IntList.

Well, in the code you have, that might be true, but as I promised, I picked up work on it again. And my new version only needs add() ;-)

> Huh.  Well, add(int) is already there, and clear() resets the size
> to 0 but doesn't resize the internal array, so future adds up to
> the prior capacity are free.
Exactly as it should be!

Thanks, Dscho

Previous: Shawn O. PearceNext: Johannes Schindelin
Message 14 of 15 in “Diff processing utilities”
  1. 0/6 Diff processing utilitiesShawn O. Pearce, May 2, 2009
  2. 1/6 Add set to IntListShawn O. Pearce, May 2, 2009
  3. 2/6 Add diff.Edit to describe an edit region within a fileShawn O. Pearce, May 2, 2009
  4. 3/6 Add diff.EditList to provide for a list of Edit instancesShawn O. Pearce, May 2, 2009
  5. 4/6 Add diff.RawText to index a file content for later comparesShawn O. Pearce, May 2, 2009
  6. 5/6 Teach FileHeader, HunkHeader how to create an EditListShawn O. Pearce, May 2, 2009
  7. 6/6 Add diff.DiffFormatter to create Git style unified patch scriptsShawn O. Pearce, May 2, 2009
  8. 6/6 Add diff.DiffFormatter to create Git style unified patch scriptsShawn O. Pearce, May 3, 2009
  9. 6/6 Add diff.DiffFormatter to create Git style unified patch scriptsShawn O. Pearce, May 3, 2009
  10. Robin RosenbergMay 3, 2009
  11. Shawn O. PearceMay 4, 2009
  12. Johannes SchindelinMay 4, 2009
  13. Shawn O. PearceMay 4, 2009
  14. Johannes SchindelinMay 4, 2009
  15. Johannes SchindelinMay 3, 2009

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.