This commit is contained in:
Andrea Cavalli 2021-11-12 02:52:42 +01:00
parent 23d5f700fb
commit f30ad372ed

View File

@ -41,18 +41,16 @@ public class DatabaseLong implements LLKeyValueDatabaseStructure {
try (var prevBuf = prev.receive()) {
var prevLong = prevBuf.readLong();
var alloc = singleton.getAllocator();
try (var buf = alloc.allocate(Long.BYTES)) {
var buf = alloc.allocate(Long.BYTES);
buf.writeLong(prevLong + 1);
return buf;
}
}
} else {
var alloc = singleton.getAllocator();
try (var buf = alloc.allocate(Long.BYTES)) {
var buf = alloc.allocate(Long.BYTES);
buf.writeLong(1);
return buf;
}
}
}, updateReturnMode).map(send -> {
try (var buf = send.receive()) {
return buf.readLong();