mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Simplify parseHashTypeOpt
Remove redundant "else" after "return". Use std::nullopt to increase readability.
This commit is contained in:
parent
201c115c3e
commit
e9ddf0b400
1 changed files with 4 additions and 4 deletions
|
@ -389,10 +389,10 @@ Hash compressHash(const Hash & hash, unsigned int newSize)
|
|||
std::optional<HashType> parseHashTypeOpt(std::string_view s)
|
||||
{
|
||||
if (s == "md5") return htMD5;
|
||||
else if (s == "sha1") return htSHA1;
|
||||
else if (s == "sha256") return htSHA256;
|
||||
else if (s == "sha512") return htSHA512;
|
||||
else return std::optional<HashType> {};
|
||||
if (s == "sha1") return htSHA1;
|
||||
if (s == "sha256") return htSHA256;
|
||||
if (s == "sha512") return htSHA512;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
HashType parseHashType(std::string_view s)
|
||||
|
|
Loading…
Reference in a new issue