mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Small speedup, per issue 422
git-svn-id: https://zxing.googlecode.com/svn/trunk@1395 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
c6f29f2ebc
commit
a86b0e7cf3
|
@ -130,13 +130,10 @@ public final class GF256 {
|
|||
if (a == 0 || b == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (a == 1) {
|
||||
return b;
|
||||
}
|
||||
if (b == 1) {
|
||||
return a;
|
||||
}
|
||||
return expTable[(logTable[a] + logTable[b]) % 255];
|
||||
int logSum = logTable[a] + logTable[b];
|
||||
// index is a sped-up alternative to logSum % 255 since sum
|
||||
// is in [0,510]. Thanks to jmsachs for the idea
|
||||
return expTable[(logSum & 0xFF) + (logSum >>> 8)];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue