Make clang-tidy changes
clang-tidy has a number of checks it recommends. These checks are
documented in the next commit, but make the code pass our coding
standard.
Tested:
Minor changes made by the robot.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I6cfaab92211af9c4c1eccd981ba9fe7b8c523457
diff --git a/include/utils.hpp b/include/utils.hpp
index bc8ac1b..99e2f85 100644
--- a/include/utils.hpp
+++ b/include/utils.hpp
@@ -132,22 +132,20 @@
}
std::optional<std::string> templateCharReplace(
- nlohmann::json::iterator& keyPair, const DBusObject& object,
- const size_t index,
+ nlohmann::json::iterator& keyPair, const DBusObject& object, size_t index,
const std::optional<std::string>& replaceStr = std::nullopt);
std::optional<std::string> templateCharReplace(
nlohmann::json::iterator& keyPair, const DBusInterface& interface,
- const size_t index,
- const std::optional<std::string>& replaceStr = std::nullopt);
+ size_t index, const std::optional<std::string>& replaceStr = std::nullopt);
inline bool deviceHasLogging(const nlohmann::json& json)
{
auto logging = json.find("Logging");
if (logging != json.end())
{
- auto ptr = logging->get_ptr<const std::string*>();
- if (ptr)
+ const auto* ptr = logging->get_ptr<const std::string*>();
+ if (ptr != nullptr)
{
if (*ptr == "Off")
{