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

Re: [JGIT PATCH (RESEND) 3/3] Fix DirCache.findEntry to work on an empty cache

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Sep 3, 2009, 23:14 UTC
Message-ID
<200909040114.12980.robin.rosenberg@dewire.com>
In-Reply-To
<1251847010-9992-3-git-send-email-spearce@spearce.org>
onsdag 02 september 2009 01:16:50 skrev "Shawn O. Pearce" <spearce@spearce.org>:
Show 10 quoted lines
> If the cache has no entries, we want to return -1 rather than throw
> ArrayIndexOutOfBoundsException.  This binary search loop was stolen
> from some other code which contained a test before the loop to see if
> the collection was empty or not, but we failed to include that here.
> 
> Flipping the loop around to a standard while loop ensures we test
> the condition properly first.
> 
> Signed-off-by: Shawn O. Pearce <sop@google.com>
> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Is this a new policy?
-- robin
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 4 of 7 in “Allow RefUpdate.setExpectedOldObjectId to accept RevCommit”
  1. 1/3 Allow RefUpdate.setExpectedOldObjectId to accept RevCommitShawn O. Pearce, Sep 1, 2009
  2. 2/3 Work around Sun javac compiler error in RefUpdateShawn O. Pearce, Sep 1, 2009
  3. 3/3 Fix DirCache.findEntry to work on an empty cacheShawn O. Pearce, Sep 1, 2009
  4. Robin RosenbergSep 3, 2009
  5. Shawn O. PearceSep 3, 2009
  6. Nicolas PitreSep 4, 2009
  7. Shawn O. PearceSep 1, 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.