commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1297012 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
Date Mon, 05 Mar 2012 11:40:36 GMT
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 +



Mime
View raw message