Only initialize search::options once.

This commit is contained in:
tastytea 2021-05-25 10:02:34 +02:00
parent af58d6e35a
commit ce015954ea
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 27 additions and 27 deletions

View File

@ -75,12 +75,6 @@ int main(int argc, char *argv[])
// TODO: Read data from stdin.
}
else
{
for (const auto &filepath :
vm["input-file"].as<std::vector<std::string>>())
{
for (const auto &regex :
vm["regexp"].as<std::vector<std::string>>())
{
search::options opts;
if (vm.count("basic-regexp") > 0)
@ -109,6 +103,12 @@ int main(int argc, char *argv[])
}
opts.context = vm["context"].as<std::uint64_t>();
for (const auto &filepath :
vm["input-file"].as<std::vector<std::string>>())
{
for (const auto &regex :
vm["regexp"].as<std::vector<std::string>>())
{
try
{
for (const auto &match :