perf[orm]: optimize codec registration

This commit is contained in:
godotg
2024-06-14 18:52:13 +08:00
parent 4c20ada20a
commit 5652fdd3f9
2 changed files with 2 additions and 2 deletions
@@ -41,7 +41,7 @@ public class IntMapCodec<V> implements Codec<Map<Integer, V>> {
@Override
public Map<Integer, V> decode(final BsonReader reader, final DecoderContext context) {
reader.readStartDocument();
Map<Integer, V> map = new HashMap<>();
var map = new HashMap<Integer, V>();
while (!BsonType.END_OF_DOCUMENT.equals(reader.readBsonType())) {
int key = Integer.parseInt(reader.readName());
V value = BsonType.NULL.equals(reader.getCurrentBsonType()) ? null : valueCodec.decode(reader, context);
@@ -41,7 +41,7 @@ public class LongMapCodec<V> implements Codec<Map<Long, V>> {
@Override
public Map<Long, V> decode(final BsonReader reader, final DecoderContext context) {
reader.readStartDocument();
Map<Long, V> map = new HashMap<>();
var map = new HashMap<Long, V>();
while (!BsonType.END_OF_DOCUMENT.equals(reader.readBsonType())) {
long key = Long.parseLong(reader.readName());
V value = BsonType.NULL.equals(reader.getCurrentBsonType()) ? null : valueCodec.decode(reader, context);