Upgraded to hppc version 0.5.3

This commit is contained in:
Martijn van Groningen 2013-11-10 20:38:24 +01:00
parent a305fb08d6
commit 9fdcb0ad05
3 changed files with 7 additions and 8 deletions

View File

@ -172,7 +172,7 @@
<dependency>
<groupId>com.carrotsearch</groupId>
<artifactId>hppc</artifactId>
<version>0.5.2</version>
<version>0.5.3</version>
</dependency>
<dependency>

View File

@ -190,6 +190,11 @@ public final class ImmutableOpenMap<KType, VType> implements Iterable<ObjectObje
return map.get(key);
}
@Override
public VType getOrDefault(KType kType, VType vType) {
return map.getOrDefault(kType, vType);
}
@Override
public int putAll(ObjectObjectAssociativeContainer<? extends KType, ? extends VType> container) {
return map.putAll(container);

View File

@ -59,13 +59,7 @@ public class SimpleIdReaderTypeCache implements IdReaderTypeCache {
}
public int docById(HashedBytesArray uid) {
if (idToDoc.containsKey(uid)) {
// We can't use #lget() here since the idToDoc map shared across threads, so we really need a second lookup...
// BTW: This method is only used via TopChildrenQuery
return idToDoc.get(uid);
} else {
return -1;
}
return idToDoc.getOrDefault(uid, -1);
}
public HashedBytesArray idByDoc(int docId) {