Skip to content
Snippets Groups Projects
Commit 017e42fb authored by Damon Kohler's avatar Damon Kohler
Browse files

Changes xxxArrayField to stop relying on FieldTypes for deserialization. This...

Changes xxxArrayField to stop relying on FieldTypes for deserialization. This avoids unnecessary auto(un)boxing which hurts performance.
parent 09601cc4
Branches
Tags
No related merge requests found
...@@ -71,7 +71,7 @@ public class BooleanArrayField extends Field { ...@@ -71,7 +71,7 @@ public class BooleanArrayField extends Field {
} }
value = new boolean[currentSize]; value = new boolean[currentSize];
for (int i = 0; i < currentSize; i++) { for (int i = 0; i < currentSize; i++) {
value[i] = (Boolean) type.deserialize(buffer); value[i] = buffer.readByte() == 1;
} }
} }
......
...@@ -71,7 +71,7 @@ public class ByteArrayField extends Field { ...@@ -71,7 +71,7 @@ public class ByteArrayField extends Field {
} }
value = new byte[currentSize]; value = new byte[currentSize];
for (int i = 0; i < currentSize; i++) { for (int i = 0; i < currentSize; i++) {
value[i] = (Byte) type.deserialize(buffer); value[i] = buffer.readByte();
} }
} }
......
...@@ -71,7 +71,7 @@ public class DoubleArrayField extends Field { ...@@ -71,7 +71,7 @@ public class DoubleArrayField extends Field {
} }
value = new double[currentSize]; value = new double[currentSize];
for (int i = 0; i < currentSize; i++) { for (int i = 0; i < currentSize; i++) {
value[i] = (Double) type.deserialize(buffer); value[i] = buffer.readDouble();
} }
} }
......
...@@ -71,7 +71,7 @@ public class FloatArrayField extends Field { ...@@ -71,7 +71,7 @@ public class FloatArrayField extends Field {
} }
value = new float[currentSize]; value = new float[currentSize];
for (int i = 0; i < currentSize; i++) { for (int i = 0; i < currentSize; i++) {
value[i] = (Float) type.deserialize(buffer); value[i] = buffer.readFloat();
} }
} }
......
...@@ -71,7 +71,7 @@ public class IntegerArrayField extends Field { ...@@ -71,7 +71,7 @@ public class IntegerArrayField extends Field {
} }
value = new int[currentSize]; value = new int[currentSize];
for (int i = 0; i < currentSize; i++) { for (int i = 0; i < currentSize; i++) {
value[i] = (Integer) type.deserialize(buffer); value[i] = buffer.readInt();
} }
} }
......
...@@ -73,7 +73,7 @@ public class LongArrayField extends Field { ...@@ -73,7 +73,7 @@ public class LongArrayField extends Field {
} }
value = new long[currentSize]; value = new long[currentSize];
for (int i = 0; i < currentSize; i++) { for (int i = 0; i < currentSize; i++) {
value[i] = (Long) type.deserialize(buffer); value[i] = buffer.readLong();
} }
} }
......
...@@ -71,7 +71,7 @@ public class ShortArrayField extends Field { ...@@ -71,7 +71,7 @@ public class ShortArrayField extends Field {
} }
value = new short[currentSize]; value = new short[currentSize];
for (int i = 0; i < currentSize; i++) { for (int i = 0; i < currentSize; i++) {
value[i] = (Short) type.deserialize(buffer); value[i] = buffer.readShort();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment