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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



onsdag 02 september 2009 01:16:50 skrev "Shawn O. Pearce" <spearce@xxxxxxxxxxx>:
> 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@xxxxxxxxxx>
> Signed-off-by: Shawn O. Pearce <spearce@xxxxxxxxxxx>

Is this a new policy?

-- robin
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]