From: Robin Rosenberg Date: Thu, 03 Sep 2009 23:14:12 GMT Subject: Re: [JGIT PATCH (RESEND) 3/3] Fix DirCache.findEntry to work on an empty cache 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" : > 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 > Signed-off-by: Shawn O. Pearce Is this a new policy? -- robin