1
0
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:
Brad King
2025-09-25 16:01:53 -04:00
parent 67ed07af23
commit b7397f2f29

View File

@@ -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);
}