mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 04:54:04 -08:00
Simplify old multiply logic for GF
git-svn-id: https://zxing.googlecode.com/svn/trunk@2185 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
0cf9ec342f
commit
f1dc6c6dcd
|
@ -163,26 +163,18 @@ public final class GenericGF {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param a
|
||||
* @param b
|
||||
* @return product of a and b in GF(size)
|
||||
*/
|
||||
int multiply(int a, int b) {
|
||||
checkInit();
|
||||
|
||||
|
||||
if (a == 0 || b == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (a<0 || b <0 || a>=size || b >=size){
|
||||
a++;
|
||||
}
|
||||
|
||||
int logSum = logTable[a] + logTable[b];
|
||||
return expTable[(logSum % size) + logSum / size];
|
||||
return expTable[(logTable[a] + logTable[b]) % (size - 1)];
|
||||
}
|
||||
|
||||
public int getSize(){
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue