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:
Michael Stack 2012-02-20 21:46:04 +00:00
parent ad14643d55
commit 6da328e0fb
1 changed files with 1 additions and 1 deletions

View File

@ -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);