You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2012/03/05 12:40:36 UTC

svn commit: r1297012 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java

Author: bodewig
Date: Mon Mar  5 11:40:35 2012
New Revision: 1297012

URL: http://svn.apache.org/viewvc?rev=1297012&view=rev
Log:
tiny performance tweak

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java?rev=1297012&r1=1297011&r2=1297012&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java Mon Mar  5 11:40:35 2012
@@ -380,7 +380,7 @@ public class TarUtils {
                                          final int offset, final int length,
                                          final boolean negative) {
         final int bits = (length - 1) * 8;
-        final long max = (long) Math.pow(2, bits);
+        final long max = 1l << bits;
         long val = Math.abs(value);
         if (val >= max) {
             throw new IllegalArgumentException("Value " + value +