Modify Cppcheck::addFile() only take one file as a parameter.
CLI and GUI already do the directory walking for us and we have list of files to check. So we were duplicating this directory walking. Practically doing check again for each file if it is a directory. Which can take some time with large amount of files.
This commit is contained in:
parent
b247d7d56e
commit
4668e19060
|
@ -56,14 +56,14 @@ void CppCheck::settings(const Settings ¤tSettings)
|
||||||
_settings = currentSettings;
|
_settings = currentSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppCheck::addFile(const std::string &path)
|
void CppCheck::addFile(const std::string &filepath)
|
||||||
{
|
{
|
||||||
getFileLister()->recursiveAddFiles(_filenames, path.c_str());
|
_filenames.push_back(Path::fromNativeSeparators(filepath));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppCheck::addFile(const std::string &path, const std::string &content)
|
void CppCheck::addFile(const std::string &path, const std::string &content)
|
||||||
{
|
{
|
||||||
_filenames.push_back(path);
|
_filenames.push_back(Path::fromNativeSeparators(path));
|
||||||
_fileContents[ path ] = content;
|
_fileContents[ path ] = content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,10 +77,8 @@ public:
|
||||||
* @param path Relative or absolute path to the file to be checked,
|
* @param path Relative or absolute path to the file to be checked,
|
||||||
* e.g. "cppcheck.cpp". Note that only source files (.c, .cc or .cpp)
|
* e.g. "cppcheck.cpp". Note that only source files (.c, .cc or .cpp)
|
||||||
* should be added to the list. Include files are gathered automatically.
|
* should be added to the list. Include files are gathered automatically.
|
||||||
* You can also give path, e.g. "src/" which will be scanned for source
|
|
||||||
* files recursively.
|
|
||||||
*/
|
*/
|
||||||
void addFile(const std::string &path);
|
void addFile(const std::string &filepath);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add new unreal file to be checked.
|
* @brief Add new unreal file to be checked.
|
||||||
|
|
Loading…
Reference in New Issue