]> source.dussan.org Git - jgit.git/commit
ObjectIdSubclassMap: Support duplicate additions 61/2361/2
authorShawn O. Pearce <spearce@spearce.org>
Fri, 28 Jan 2011 01:20:36 +0000 (17:20 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 28 Jan 2011 16:17:20 +0000 (08:17 -0800)
commit17dc6bdafd6399a94f2b64357ea48873f6b71b2a
treed89881985cf07d28a100851c8fb12bbbe0bf4227
parent0b2ac1e929292d385855dba26e753d09a9e14255
ObjectIdSubclassMap: Support duplicate additions

The new addIfAbsent() method combines get() with add(), but does
it in a single step so that the common case of get() returning null
for a new object can immediately insert the object into the map.

Change-Id: Ib599ab4de13ad67665ccfccf3ece52ba3222bcba
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdSubclassMapTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdSubclassMap.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/CachedObjectDirectory.java