File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
src/filepattern/cpp/internal Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -100,8 +100,6 @@ void FilePatternObject::matchFilesMultDir(){
100100 std::smatch sm;
101101 std::string file, file_path;
102102
103- bool is_pushed = false ;
104-
105103 // Iterate over directories and subdirectories
106104 for (const auto & entry : this ->recursive_iterator_ ) {
107105
@@ -123,18 +121,12 @@ void FilePatternObject::matchFilesMultDir(){
123121 tup = getVariableMapMultDir (file_path, sm);
124122 }
125123
126- if (std::get<0 >(tup).size () > 0 ){
127- this ->valid_files_ .push_back (tup);
128- is_pushed = true ;
129- } else {
130- is_pushed = false ;
124+ // If the path vector in the tuple is not empty, it's a valid match
125+ if (!std::get<1 >(tup).empty ()){
126+ this ->valid_files_ .push_back (tup);
131127 }
132128 }
133129 }
134-
135- if (!is_pushed && std::get<1 >(tup).size () > 0 ) {
136- this ->valid_files_ .push_back (tup);
137- }
138130}
139131
140132void FilePatternObject::matchFiles () {
You can’t perform that action at this time.
0 commit comments