diff options
author | lloyd <[email protected]> | 2006-05-27 16:41:24 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-05-27 16:41:24 +0000 |
commit | c4204430b1c050c54a464b677c4a90a785542b1a (patch) | |
tree | 980cffcf93a8b74cac0ee155faa6e95fd594739b /src/def_alg.cpp | |
parent | a5c9bc9588c21d97ae66ca56c0198f91d134a7fd (diff) |
Use .empty() instead of comparing .size() to 0 in a few cases, and
reorder an if statement for better readability.
Diffstat (limited to 'src/def_alg.cpp')
-rw-r--r-- | src/def_alg.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/def_alg.cpp b/src/def_alg.cpp index 9b87f6c2a..9b24e07c1 100644 --- a/src/def_alg.cpp +++ b/src/def_alg.cpp @@ -110,7 +110,7 @@ BlockCipher* Default_Engine::find_block_cipher(const std::string& algo_spec) const { std::vector<std::string> name = parse_algorithm_name(algo_spec); - if(name.size() == 0) + if(name.empty()) return 0; const std::string algo_name = deref_alias(name[0]); @@ -158,7 +158,7 @@ StreamCipher* Default_Engine::find_stream_cipher(const std::string& algo_spec) const { std::vector<std::string> name = parse_algorithm_name(algo_spec); - if(name.size() == 0) + if(name.empty()) return 0; const std::string algo_name = deref_alias(name[0]); @@ -177,7 +177,7 @@ HashFunction* Default_Engine::find_hash(const std::string& algo_spec) const { std::vector<std::string> name = parse_algorithm_name(algo_spec); - if(name.size() == 0) + if(name.empty()) return 0; const std::string algo_name = deref_alias(name[0]); @@ -215,7 +215,7 @@ MessageAuthenticationCode* Default_Engine::find_mac(const std::string& algo_spec) const { std::vector<std::string> name = parse_algorithm_name(algo_spec); - if(name.size() == 0) + if(name.empty()) return 0; const std::string algo_name = deref_alias(name[0]); @@ -232,7 +232,7 @@ Default_Engine::find_mac(const std::string& algo_spec) const S2K* Default_Engine::find_s2k(const std::string& algo_spec) const { std::vector<std::string> name = parse_algorithm_name(algo_spec); - if(name.size() == 0) + if(name.empty()) return 0; const std::string algo_name = deref_alias(name[0]); @@ -251,7 +251,7 @@ BlockCipherModePaddingMethod* Default_Engine::find_bc_pad(const std::string& algo_spec) const { std::vector<std::string> name = parse_algorithm_name(algo_spec); - if(name.size() == 0) + if(name.empty()) return 0; const std::string algo_name = deref_alias(name[0]); |