HBASE-5436 Right-size the map when reading attributes.
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1291463 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ad14643d55
commit
6da328e0fb
|
@ -96,7 +96,7 @@ public abstract class OperationWithAttributes extends Operation implements Attri
|
|||
protected void readAttributes(final DataInput in) throws IOException {
|
||||
int numAttributes = in.readInt();
|
||||
if (numAttributes > 0) {
|
||||
this.attributes = new HashMap<String, byte[]>();
|
||||
this.attributes = new HashMap<String, byte[]>(numAttributes);
|
||||
for(int i=0; i<numAttributes; i++) {
|
||||
String name = WritableUtils.readString(in);
|
||||
byte[] value = Bytes.readByteArray(in);
|
||||
|
|
Loading…
Reference in New Issue