From d6549fca783b406680dca3468550a57aabc34875 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 28 Jan 2017 21:34:51 -0500 Subject: [PATCH] CmdDiagnostics: Code cleanup --- src/commands/CmdDiagnostics.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/commands/CmdDiagnostics.cpp b/src/commands/CmdDiagnostics.cpp index 03c9faa66..3950c6429 100644 --- a/src/commands/CmdDiagnostics.cpp +++ b/src/commands/CmdDiagnostics.cpp @@ -224,7 +224,7 @@ int CmdDiagnostics::execute (std::string& output) << context.config.get ("taskd.server") << '\n'; - std::string ca_pem = context.config.get ("taskd.ca"); + auto ca_pem = context.config.get ("taskd.ca"); out << " CA: "; if (ca_pem != "") { @@ -240,7 +240,7 @@ int CmdDiagnostics::execute (std::string& output) else out << "-\n"; - std::string cert_pem = context.config.get ("taskd.certificate"); + auto cert_pem = context.config.get ("taskd.certificate"); out << "Certificate: "; if (cert_pem != "") { @@ -256,7 +256,7 @@ int CmdDiagnostics::execute (std::string& output) else out << "-\n"; - std::string key_pem = context.config.get ("taskd.key"); + auto key_pem = context.config.get ("taskd.key"); out << " Key: "; if (key_pem != "") { @@ -272,7 +272,7 @@ int CmdDiagnostics::execute (std::string& output) else out << "-\n"; - std::string trust_value = context.config.get ("taskd.trust"); + auto trust_value = context.config.get ("taskd.trust"); if (trust_value == "strict" || trust_value == "ignore hostname" || trust_value == "allow all") @@ -285,7 +285,7 @@ int CmdDiagnostics::execute (std::string& output) << '\n'; // Get credentials, but mask out the key. - std::string credentials = context.config.get ("taskd.credentials"); + auto credentials = context.config.get ("taskd.credentials"); auto last_slash = credentials.rfind ('/'); if (last_slash != std::string::npos) credentials = credentials.substr (0, last_slash) @@ -408,7 +408,7 @@ int CmdDiagnostics::execute (std::string& output) << ")\n"; // Scan tasks for duplicate UUIDs. - std::vector all = context.tdb2.all_tasks (); + auto all = context.tdb2.all_tasks (); std::map seen; std::vector dups; std::string uuid; @@ -458,7 +458,7 @@ int CmdDiagnostics::execute (std::string& output) } // Check recurrence parent - std::string parentUUID = task.get ("parent"); + auto parentUUID = task.get ("parent"); if (parentUUID != "" && ! context.tdb2.has (parentUUID)) {