Use EMPTY_BYTES in WireFormatNano

pull/213/head
Jisi Liu 10 years ago
parent c265fbe3ca
commit fbfdbe8ad8
  1. 3
      javanano/src/main/java/com/google/protobuf/nano/InternalNano.java

@ -354,13 +354,12 @@ public final class InternalNano {
} }
return result; return result;
} }
private static final byte[] EMPTY_BYTES = new byte[0];
private static Object primitiveDefaultValue(int type) { private static Object primitiveDefaultValue(int type) {
switch (type) { switch (type) {
case TYPE_BOOL: case TYPE_BOOL:
return Boolean.FALSE; return Boolean.FALSE;
case TYPE_BYTES: case TYPE_BYTES:
return EMPTY_BYTES; return WireFormatNano.EMPTY_BYTES;
case TYPE_STRING: case TYPE_STRING:
return ""; return "";
case TYPE_FLOAT: case TYPE_FLOAT:

Loading…
Cancel
Save