summaryrefslogtreecommitdiffstats
path: root/Source/cmCryptoHash.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-23 13:00:00 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-08-23 13:00:00 (GMT)
commit797f7ad87d6f1b6dd7cbbb553d5525ac8ee390f1 (patch)
treef5922b06caf987f6faff13f8c2ba8e0f164457f6 /Source/cmCryptoHash.cxx
parent762131fe8d585ced6b259a451ccde8fded2a8ca4 (diff)
parent7b6349da4dc968691f1a374211fcc153c8b4f1c6 (diff)
downloadCMake-797f7ad87d6f1b6dd7cbbb553d5525ac8ee390f1.zip
CMake-797f7ad87d6f1b6dd7cbbb553d5525ac8ee390f1.tar.gz
CMake-797f7ad87d6f1b6dd7cbbb553d5525ac8ee390f1.tar.bz2
Merge topic 'else-after-return'
7b6349da CMake: don't use else after return 50ad1e0a CTest: don't use else after return 7f97a6c9 CPack: don't use else after return 4988b914 CursesDialog: don't use else after return
Diffstat (limited to 'Source/cmCryptoHash.cxx')
-rw-r--r--Source/cmCryptoHash.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index 9bd07a3..8e2d87e 100644
--- a/Source/cmCryptoHash.cxx
+++ b/Source/cmCryptoHash.cxx
@@ -19,19 +19,23 @@ CM_AUTO_PTR<cmCryptoHash> cmCryptoHash::New(const char* algo)
{
if (strcmp(algo, "MD5") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashMD5);
- } else if (strcmp(algo, "SHA1") == 0) {
+ }
+ if (strcmp(algo, "SHA1") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA1);
- } else if (strcmp(algo, "SHA224") == 0) {
+ }
+ if (strcmp(algo, "SHA224") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA224);
- } else if (strcmp(algo, "SHA256") == 0) {
+ }
+ if (strcmp(algo, "SHA256") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA256);
- } else if (strcmp(algo, "SHA384") == 0) {
+ }
+ if (strcmp(algo, "SHA384") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA384);
- } else if (strcmp(algo, "SHA512") == 0) {
+ }
+ if (strcmp(algo, "SHA512") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA512);
- } else {
- return CM_AUTO_PTR<cmCryptoHash>(CM_NULLPTR);
}
+ return CM_AUTO_PTR<cmCryptoHash>(CM_NULLPTR);
}
bool cmCryptoHash::IntFromHexDigit(char input, char& output)
@@ -39,10 +43,12 @@ bool cmCryptoHash::IntFromHexDigit(char input, char& output)
if (input >= '0' && input <= '9') {
output = char(input - '0');
return true;
- } else if (input >= 'a' && input <= 'f') {
+ }
+ if (input >= 'a' && input <= 'f') {
output = char(input - 'a' + 0xA);
return true;
- } else if (input >= 'A' && input <= 'F') {
+ }
+ if (input >= 'A' && input <= 'F') {
output = char(input - 'A' + 0xA);
return true;
}