summaryrefslogtreecommitdiffstats
path: root/Source/cmCryptoHash.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-08-18 18:36:29 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-08-18 18:36:29 (GMT)
commit7b6349da4dc968691f1a374211fcc153c8b4f1c6 (patch)
treebb0fc76955ef3166c3416522fef009c9d65ab7f3 /Source/cmCryptoHash.cxx
parent50ad1e0a144ae1f2267a4966789e5a16372f458e (diff)
downloadCMake-7b6349da4dc968691f1a374211fcc153c8b4f1c6.zip
CMake-7b6349da4dc968691f1a374211fcc153c8b4f1c6.tar.gz
CMake-7b6349da4dc968691f1a374211fcc153c8b4f1c6.tar.bz2
CMake: 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;
}