mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-12 22:15:02 +00:00
perf[orm]: optimize codec registration
This commit is contained in:
1 parent
4c20ada20a
commit
5652fdd3f9
2 files changed
+2
-2
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user