Improved checksum algorithm to fix configurations being purged by coincidence (#6126):

- Better distribution of values by rotating the bits of the checksum for each token
This commit is contained in:
PKEuS 2014-09-03 23:09:40 +02:00
parent 270f59e76a
commit e4a81f9666
1 changed files with 5 additions and 0 deletions

View File

@ -410,6 +410,11 @@ unsigned long long TokenList::calculateChecksum() const
} }
checksum ^= ((static_cast<unsigned long long>(subchecksum1) << 32) | subchecksum2); checksum ^= ((static_cast<unsigned long long>(subchecksum1) << 32) | subchecksum2);
bool bit1 = (checksum & 1) != 0;
checksum >>= 1;
if (bit1)
checksum |= (1ULL << 63);
} }
return checksum; return checksum;
} }