[Joafip-svn] SF.net SVN: joafip:[3062] trunk/joafip-kvstore/src/main/java/net/sf/joafip/ kvstore/e
Brought to you by:
luc_peuvrier
|
From: <luc...@us...> - 2012-05-03 02:49:03
|
Revision: 3062
http://joafip.svn.sourceforge.net/joafip/?rev=3062&view=rev
Author: luc_peuvrier
Date: 2012-05-03 02:48:57 +0000 (Thu, 03 May 2012)
Log Message:
-----------
optimization
Modified Paths:
--------------
trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java
Modified: trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java
===================================================================
--- trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java 2012-05-02 06:14:15 UTC (rev 3061)
+++ trunk/joafip-kvstore/src/main/java/net/sf/joafip/kvstore/entity/AbstractFileStorable.java 2012-05-03 02:48:57 UTC (rev 3062)
@@ -192,20 +192,23 @@
private void updateCrc32(final byte[] buffer, final int start,
final int length) {
- for (int i = 0; i < length; i++) {
- final byte byteValue = buffer[start + i];
+ int index = start;
+ for (int count = 0; count < length; count++) {
+ final byte byteValue = buffer[index++];
updateCrc32(byteValue);
}
}
private void updateCrc32(final byte byteValue) {
+ int value = byteValue;
for (int j = 0; j < 8; j++) {
- final int testbit = ((crc32 >> 31) & 1) ^ ((byteValue >> j) & 1);
+ final int testbit = ((crc32 >> 31) & 1) ^ (value & 1);
crc32 <<= 2;
if (testbit != 0) {
crc32 ^= 0x8005; /* 32 bit crc */
}
+ value >>= 1;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|