Skip to content

Commit 2bee664

Browse files
alexandeardanmar
authored andcommitted
Return non-const object to enable move compiler optimization (cppcheck-opensource#966)
1 parent 2545a62 commit 2bee664

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

cli/cppcheckexecutor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppcheck, int /*argc*/, const cha
944944

945945
#ifdef _WIN32
946946
// fix trac ticket #439 'Cppcheck reports wrong filename for filenames containing 8-bit ASCII'
947-
static inline const std::string ansiToOEM(const std::string &msg, bool doConvert)
947+
static inline std::string ansiToOEM(const std::string &msg, bool doConvert)
948948
{
949949
if (doConvert) {
950950
const unsigned msglength = msg.length();

lib/path.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ std::string Path::getFilenameExtensionInLowerCase(const std::string &path)
126126
return extension;
127127
}
128128

129-
const std::string Path::getCurrentPath()
129+
std::string Path::getCurrentPath()
130130
{
131131
char currentPath[4096];
132132

lib/path.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class CPPCHECKLIB Path {
101101
* @brief Returns the absolute path of current working directory
102102
* @return absolute path of current working directory
103103
*/
104-
static const std::string getCurrentPath();
104+
static std::string getCurrentPath();
105105

106106
/**
107107
* @brief Check if given path is absolute

0 commit comments

Comments
 (0)