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{
search::search(filepath, regex, search_settings)};
std::lock_guard<std::mutex> guard(mutex_matches_all);
matches_all.emplace_back(matches);
if (!matches.empty())
{
std::lock_guard<std::mutex> guard(mutex_matches_all);
matches_all.emplace_back(matches);
}
}
catch (const zip::exception &e)
{