mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
cmInstrumentation: Simplify test for .json file name suffix
This commit is contained in:
@@ -159,12 +159,11 @@ cmsys::SystemInformation& cmInstrumentation::GetSystemInformation()
|
||||
bool cmInstrumentation::ReadJSONQueries(std::string const& directory)
|
||||
{
|
||||
cmsys::Directory d;
|
||||
std::string json = ".json";
|
||||
bool result = false;
|
||||
if (d.Load(directory)) {
|
||||
for (unsigned int i = 0; i < d.GetNumberOfFiles(); i++) {
|
||||
std::string fpath = d.GetFilePath(i);
|
||||
if (fpath.rfind(json) == (fpath.size() - json.size())) {
|
||||
if (cmHasLiteralSuffix(fpath, ".json")) {
|
||||
result = true;
|
||||
this->ReadJSONQuery(fpath);
|
||||
}
|
||||
|
Reference in New Issue
Block a user