mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Remove redundant parentheses.
This commit is contained in:
@@ -109,7 +109,7 @@ namespace DiscImageChef.Checksums
|
||||
}
|
||||
|
||||
eccA = eccBTable[eccFTable[eccA] ^ eccB];
|
||||
if(ecc[major] != (eccA) || ecc[major + majorCount] != (eccA ^ eccB)) { return false; }
|
||||
if(ecc[major] != eccA || ecc[major + majorCount] != (eccA ^ eccB)) { return false; }
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -169,25 +169,25 @@ namespace DiscImageChef.Checksums
|
||||
|
||||
static int Min(int a, int b)
|
||||
{
|
||||
return ((a) < (b) ? (a) : (b));
|
||||
return a < b ? a : b;
|
||||
}
|
||||
|
||||
static void Clear(ref int[] a, int n)
|
||||
{
|
||||
int ci;
|
||||
for(ci = (n) - 1; ci >= 0; ci--) (a)[ci] = 0;
|
||||
for(ci = n - 1; ci >= 0; ci--) a[ci] = 0;
|
||||
}
|
||||
|
||||
static void Copy(ref int[] a, ref int[] b, int n)
|
||||
{
|
||||
int ci;
|
||||
for(ci = (n) - 1; ci >= 0; ci--) (a)[ci] = (b)[ci];
|
||||
for(ci = n - 1; ci >= 0; ci--) a[ci] = b[ci];
|
||||
}
|
||||
|
||||
static void Copydown(ref int[] a, ref int[] b, int n)
|
||||
{
|
||||
int ci;
|
||||
for(ci = (n) - 1; ci >= 0; ci--) (a)[ci] = (b)[ci];
|
||||
for(ci = n - 1; ci >= 0; ci--) a[ci] = b[ci];
|
||||
}
|
||||
|
||||
/* generate GF(2**m) from the irreducible polynomial p(X) in p[0]..p[m]
|
||||
@@ -280,10 +280,10 @@ namespace DiscImageChef.Checksums
|
||||
* (@**(B0+i-1) + x)
|
||||
*/
|
||||
for(j = i - 1; j > 0; j--)
|
||||
if(gg[j] != 0) gg[j] = gg[j - 1] ^ alpha_to[Modnn((index_of[gg[j]]) + B0 + i - 1)];
|
||||
if(gg[j] != 0) gg[j] = gg[j - 1] ^ alpha_to[Modnn(index_of[gg[j]] + B0 + i - 1)];
|
||||
else gg[j] = gg[j - 1];
|
||||
/* Gg[0] can never be zero */
|
||||
gg[0] = alpha_to[Modnn((index_of[gg[0]]) + B0 + i - 1)];
|
||||
gg[0] = alpha_to[Modnn(index_of[gg[0]] + B0 + i - 1)];
|
||||
}
|
||||
/* convert Gg[] to index form for quicker encoding */
|
||||
for(i = 0; i <= nn - kk; i++) gg[i] = index_of[gg[i]];
|
||||
@@ -485,7 +485,7 @@ namespace DiscImageChef.Checksums
|
||||
discrR = 0;
|
||||
for(i = 0; i < r; i++)
|
||||
{
|
||||
if((lambda[i] != 0) && (s[r - i] != a0))
|
||||
if(lambda[i] != 0 && s[r - i] != a0)
|
||||
{
|
||||
discrR ^= alpha_to[Modnn(index_of[lambda[i]] + s[r - i])];
|
||||
}
|
||||
@@ -516,7 +516,7 @@ namespace DiscImageChef.Checksums
|
||||
* lambda(x)
|
||||
*/
|
||||
for(i = 0; i <= nn - kk; i++)
|
||||
b[i] = (lambda[i] == 0) ? a0 : Modnn(index_of[lambda[i]] - discrR + nn);
|
||||
b[i] = lambda[i] == 0 ? a0 : Modnn(index_of[lambda[i]] - discrR + nn);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -586,10 +586,10 @@ namespace DiscImageChef.Checksums
|
||||
for(i = 0; i < nn - kk; i++)
|
||||
{
|
||||
tmp = 0;
|
||||
j = (degLambda < i) ? degLambda : i;
|
||||
j = degLambda < i ? degLambda : i;
|
||||
for(; j >= 0; j--)
|
||||
{
|
||||
if((s[i + 1 - j] != a0) && (lambda[j] != a0)) tmp ^= alpha_to[Modnn(s[i + 1 - j] + lambda[j])];
|
||||
if(s[i + 1 - j] != a0 && lambda[j] != a0) tmp ^= alpha_to[Modnn(s[i + 1 - j] + lambda[j])];
|
||||
}
|
||||
|
||||
if(tmp != 0) degOmega = i;
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace DiscImageChef.Checksums
|
||||
const uint HASH_INIT = 0x28021967;
|
||||
const uint NUM_BLOCKHASHES = 31;
|
||||
const uint SPAMSUM_LENGTH = 64;
|
||||
const uint FUZZY_MAX_RESULT = (2 * SPAMSUM_LENGTH + 20);
|
||||
const uint FUZZY_MAX_RESULT = 2 * SPAMSUM_LENGTH + 20;
|
||||
//"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
readonly byte[] b64 =
|
||||
{
|
||||
@@ -169,7 +169,7 @@ namespace DiscImageChef.Checksums
|
||||
|
||||
static uint SSDEEP_BS(uint index)
|
||||
{
|
||||
return (MIN_BLOCKSIZE << (int)index);
|
||||
return MIN_BLOCKSIZE << (int)index;
|
||||
}
|
||||
|
||||
void fuzzy_try_fork_blockhash()
|
||||
@@ -249,7 +249,7 @@ namespace DiscImageChef.Checksums
|
||||
* our signature. This has the effect of combining the
|
||||
* last few pieces of the message into a single piece
|
||||
* */
|
||||
self.Bh[i].Digest[++(self.Bh[i].Dlen)] = 0;
|
||||
self.Bh[i].Digest[++self.Bh[i].Dlen] = 0;
|
||||
self.Bh[i].H = HASH_INIT;
|
||||
if(self.Bh[i].Dlen < SPAMSUM_LENGTH / 2)
|
||||
{
|
||||
@@ -306,7 +306,7 @@ namespace DiscImageChef.Checksums
|
||||
while(bi >= self.Bhend) --bi;
|
||||
while(bi > self.Bhstart && self.Bh[bi].Dlen < SPAMSUM_LENGTH / 2) --bi;
|
||||
|
||||
if((bi > 0 && self.Bh[bi].Dlen < SPAMSUM_LENGTH / 2)) throw new Exception("Assertion failed");
|
||||
if(bi > 0 && self.Bh[bi].Dlen < SPAMSUM_LENGTH / 2) throw new Exception("Assertion failed");
|
||||
|
||||
sb.AppendFormat("{0}:", SSDEEP_BS(bi));
|
||||
i = Encoding.ASCII.GetBytes(sb.ToString()).Length;
|
||||
|
||||
Reference in New Issue
Block a user