Do not add empty matches to matches_all.

This commit is contained in:
tastytea 2021-06-01 20:15:05 +02:00
parent 21989aabfe
commit 6a4511099f
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07

View File

@ -150,8 +150,11 @@ int main(int argc, char *argv[])
{ {
auto matches{ auto matches{
search::search(filepath, regex, search_settings)}; search::search(filepath, regex, search_settings)};
std::lock_guard<std::mutex> guard(mutex_matches_all); if (!matches.empty())
matches_all.emplace_back(matches); {
std::lock_guard<std::mutex> guard(mutex_matches_all);
matches_all.emplace_back(matches);
}
} }
catch (const zip::exception &e) catch (const zip::exception &e)
{ {