From 95c628e04d70a74037a091d133df2a1c346dc18d Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Thu, 26 Dec 2013 17:54:49 +0000 Subject: [PATCH] Remove unnecessary separate length, an array already has one git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1553522 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/openxml4j/opc/internal/MemoryPackagePart.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java index b6c56949d4..f38d7a26d8 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/MemoryPackagePart.java @@ -44,11 +44,6 @@ public final class MemoryPackagePart extends PackagePart { */ protected byte[] data; - /** - * Size of data. - */ - protected int length; - /** * Constructor. * @@ -104,12 +99,11 @@ public final class MemoryPackagePart extends PackagePart { @Override public long getSize() { - return length; + return data == null ? 0 : data.length; } public void clear() { data = null; - length = 0; } @Override @@ -129,7 +123,6 @@ public final class MemoryPackagePart extends PackagePart { // Save it data = baos.toByteArray(); - length = data.length; // All done return true; -- 2.39.5