mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-01 01:16:03 -04:00
remove unnecessary null checks
This commit is contained in:
@@ -20,7 +20,6 @@ randomNumberGenerator(0),
|
||||
updateRate(newUpdateRate)
|
||||
{
|
||||
randomNumberGenerator = new RandomGenerator(unsigned(time(0))); //lint !e732 //loss of sign ok.
|
||||
NOT_NULL(randomNumberGenerator);
|
||||
Key k;
|
||||
for(unsigned int i = 0; i < getKeyCount(); i ++)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,6 @@ cipherDataLen(newCipherDataLen),
|
||||
dataLen(newDataLen)
|
||||
{
|
||||
cipherData = new unsigned char[cipherDataLen];
|
||||
NOT_NULL(cipherData);
|
||||
memcpy(cipherData, newCipherData, cipherDataLen);
|
||||
memcpy(digest, newDigest, KeyShareConstants::keyLength);
|
||||
}
|
||||
@@ -35,7 +34,6 @@ cipherDataLen(source.cipherDataLen),
|
||||
dataLen(source.dataLen)
|
||||
{
|
||||
cipherData = new unsigned char[cipherDataLen];
|
||||
NOT_NULL(cipherData);
|
||||
memcpy(cipherData, source.cipherData, cipherDataLen);
|
||||
memcpy(digest, source.digest, KeyShareConstants::keyLength);
|
||||
}
|
||||
@@ -137,10 +135,6 @@ keys(0)
|
||||
decryptors = new Crypto::TwofishDecryptor *[keyCount];
|
||||
encryptors = new Crypto::TwofishEncryptor *[keyCount];
|
||||
|
||||
NOT_NULL(keys);
|
||||
NOT_NULL(decryptors);
|
||||
NOT_NULL(encryptors);
|
||||
|
||||
for(unsigned int i = 0; i < keyCount; i ++)
|
||||
{
|
||||
decryptors[i] = 0;
|
||||
@@ -180,9 +174,6 @@ bool KeyShare::decipherToken(const KeyShare::Token & token, unsigned char * clea
|
||||
unsigned char * cipherText = new unsigned char[cipherDataLen];
|
||||
unsigned char * clearText = new unsigned char[cipherDataLen];
|
||||
|
||||
NOT_NULL(cipherText);
|
||||
NOT_NULL(clearText);
|
||||
|
||||
memcpy(cipherText, token.getData(), cipherDataLen);
|
||||
for(unsigned int i = 0; i < keyCount; i ++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user