Fix some warnings by cppcheck
Warning message:
/src/manager.cpp:255:53: warning: Division by zero [core.DivideZero]
if (((std::abs(attrValue - lowerBound)) % scalarIncrement) != 0)
include/password.hpp:84:36: performance: Function parameter 'rawData'
should be passed by const reference. [passedByValue]
const std::string rawData, const std::string algo);
^
include/password.hpp:84:63: performance: Function parameter 'algo'
should be passed by const reference. [passedByValue]
const std::string rawData, const std::string algo);
Tested: Verify that there are no such warnings in local CI.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I12276f64b06e4eddfd8cd340ebc16d04e4e9ccd5
diff --git a/src/password.cpp b/src/password.cpp
index 5231120..f780cc5 100644
--- a/src/password.cpp
+++ b/src/password.cpp
@@ -35,7 +35,7 @@
bool Password::isMatch(const std::array<uint8_t, maxHashSize>& expected,
const std::array<uint8_t, maxSeedSize>& seed,
- const std::string rawData, const std::string algo)
+ const std::string& rawData, const std::string& algo)
{
lg2::error("isMatch");