diff --git a/src/lib_cxx/project/SourceGroupCxxEmpty.cpp b/src/lib_cxx/project/SourceGroupCxxEmpty.cpp index e5e29be7..91784eca 100644 --- a/src/lib_cxx/project/SourceGroupCxxEmpty.cpp +++ b/src/lib_cxx/project/SourceGroupCxxEmpty.cpp @@ -34,8 +34,8 @@ std::set SourceGroupCxxEmpty::filterToContainedFilePaths(const std::se return utility::filterToContainedFilePaths( filePaths, - utility::toSet(indexedPaths), std::set(), + utility::toSet(indexedPaths), excludeFilters ); } diff --git a/src/lib_cxx/utility/utilitySourceGroupCxx.cpp b/src/lib_cxx/utility/utilitySourceGroupCxx.cpp index d21c8635..f2a35631 100644 --- a/src/lib_cxx/utility/utilitySourceGroupCxx.cpp +++ b/src/lib_cxx/utility/utilitySourceGroupCxx.cpp @@ -1,36 +1,29 @@ #include "utility/utilitySourceGroupCxx.h" std::set utility::filterToContainedFilePaths( - const std::set filePaths, - const std::set& indexedSourcePaths, - const std::set& indexedHeaderPaths, - const std::vector excludeFilters) + const std::set& filePaths, + const std::set& indexedFilePaths, + const std::set& indexedFileOrDirectoryPaths, + const std::vector& excludeFilters) { std::set containedFilePaths; for (const FilePath& filePath : filePaths) { bool isInIndexedPaths = false; + + for (const FilePath& indexedFileOrDirectoryPath : indexedFileOrDirectoryPaths) { - for (const FilePath& indexedHeaderPath : indexedHeaderPaths) + if (indexedFileOrDirectoryPath == filePath || indexedFileOrDirectoryPath.contains(filePath)) { - if (indexedHeaderPath == filePath || indexedHeaderPath.contains(filePath)) - { - isInIndexedPaths = true; - break; - } + isInIndexedPaths = true; + break; } } - if (!isInIndexedPaths) + + if (!isInIndexedPaths && indexedFilePaths.find(filePath) != indexedFilePaths.end()) { - for (const FilePath& indexedSourcePath : indexedSourcePaths) - { - if (indexedSourcePath == filePath) - { - isInIndexedPaths = true; - break; - } - } + isInIndexedPaths = true; } if (isInIndexedPaths) diff --git a/src/lib_cxx/utility/utilitySourceGroupCxx.h b/src/lib_cxx/utility/utilitySourceGroupCxx.h index 54eda591..103b57cd 100644 --- a/src/lib_cxx/utility/utilitySourceGroupCxx.h +++ b/src/lib_cxx/utility/utilitySourceGroupCxx.h @@ -10,10 +10,10 @@ namespace utility { std::set filterToContainedFilePaths( - const std::set filePaths, - const std::set& indexedSourcePaths, - const std::set& indexedHeaderPaths, - const std::vector excludeFilters); + const std::set& filePaths, + const std::set& indexedFilePaths, + const std::set& indexedFileOrDirectoryPaths, + const std::vector& excludeFilters); } #endif // UTILITY_SOURCE_GROUP_CXX_H