From 6c71d74563a4429585a2c1e8257262e727a11624 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Mon, 16 Jan 2017 20:10:28 +0100 Subject: [PATCH] Cleanup: There is no need to clear a string directly after its creation. --- lib/checkbufferoverrun.cpp | 2 +- lib/settings.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index b5e648b5a..c89738c70 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -195,7 +195,7 @@ void CheckBufferOverrun::pointerOutOfBoundsError(const Token *tok, const Token * // The severity is portability instead of error since this ub doesn't // cause bad behaviour on most implementations. people create out // of bounds pointers by intention. - const std::string expr(tok ? tok->expressionString() : std::string("")); + const std::string expr(tok ? tok->expressionString() : std::string()); std::string errmsg; if (index && !index->isNumber()) { errmsg = "Undefined behaviour, when '" + diff --git a/lib/settings.cpp b/lib/settings.cpp index 0199ab6d2..70ad8eba3 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -106,7 +106,7 @@ std::string Settings::addEnabled(const std::string &str) return std::string("cppcheck: there is no --enable parameter with the name '" + str + "'"); } - return std::string(""); + return std::string(); }