Bugfixes
This commit is contained in:
parent
c9f64195e7
commit
211d2fc99e
@ -11,6 +11,7 @@ import it.cavallium.dbengine.database.collections.JoinerBlocking.ValueGetterBloc
|
||||
import it.cavallium.dbengine.database.serialization.Serializer;
|
||||
import it.cavallium.dbengine.database.serialization.SerializerFixedBinaryLength;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArraySet;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectSets;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
@ -265,7 +266,7 @@ public class DatabaseMapDictionaryHashed<T, U, TH> implements DatabaseStageMap<T
|
||||
entries.add(Map.entry(key, value));
|
||||
return entries;
|
||||
} else {
|
||||
var oas = new ObjectArraySet<Entry<T, U>>(1);
|
||||
var oas = new HashSet<Entry<T, U>>(1);
|
||||
oas.add(Map.entry(key, value));
|
||||
return oas;
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import it.cavallium.dbengine.database.Delta;
|
||||
import it.cavallium.dbengine.database.LLUtils;
|
||||
import it.cavallium.dbengine.database.UpdateReturnMode;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArraySet;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectSets;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
@ -154,7 +156,7 @@ public class DatabaseSingleBucket<K, V, TH> implements DatabaseStageEntry<V> {
|
||||
entries.add(Map.entry(key, value));
|
||||
return entries;
|
||||
} else {
|
||||
var oas = new ObjectArraySet<Entry<K, V>>(1);
|
||||
var oas = new HashSet<Entry<K, V>>(1);
|
||||
oas.add(Map.entry(key, value));
|
||||
return oas;
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufAllocator;
|
||||
import it.cavallium.dbengine.database.serialization.Serializer;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArraySet;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectSets;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -21,12 +23,12 @@ class ValuesSetSerializer<X> implements Serializer<Set<X>, ByteBuf> {
|
||||
public @NotNull Set<X> deserialize(@NotNull ByteBuf serialized) {
|
||||
try {
|
||||
int entriesLength = serialized.readInt();
|
||||
Object[] values = new Object[entriesLength];
|
||||
var set = new HashSet<X>();
|
||||
for (int i = 0; i < entriesLength; i++) {
|
||||
X entry = entrySerializer.deserialize(serialized.retain());
|
||||
values[i] = entry;
|
||||
set.add(entry);
|
||||
}
|
||||
return new ObjectArraySet<>(values, values.length);
|
||||
return set;
|
||||
} finally {
|
||||
serialized.release();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user