@@ -52,15 +52,14 @@ Error SpecialCaseList::Matcher::insert(StringRef Pattern, unsigned LineNumber,
5252    if  (!CheckRE.isValid (REError))
5353      return  createStringError (errc::invalid_argument, REError);
5454
55-     RegExes.emplace_back (std::make_pair (
56-         std::make_unique<Regex>(std::move (CheckRE)), LineNumber));
55+     auto  Rg =
56+         std::make_unique<Matcher::Reg>(Pattern, LineNumber, std::move (CheckRE));
57+     RegExes.emplace_back (std::move (Rg));
5758
5859    return  Error::success ();
5960  }
6061
61-   auto  Glob = std::make_unique<Matcher::Glob>();
62-   Glob->Name  = Pattern.str ();
63-   Glob->LineNo  = LineNumber;
62+   auto  Glob = std::make_unique<Matcher::Glob>(Pattern, LineNumber);
6463  //  We must be sure to use the string in `Glob` rather than the provided
6564  //  reference which could be destroyed before match() is called
6665  if  (auto  Err = GlobPattern::create (Glob->Name , /* MaxSubPatterns=*/ 1024 )
@@ -76,9 +75,9 @@ void SpecialCaseList::Matcher::match(
7675  for  (const  auto  &Glob : reverse (Globs))
7776    if  (Glob->Pattern .match (Query))
7877      Cb (Glob->Name , Glob->LineNo );
79-   for  (const  auto  &[ Regex, LineNumber]  : reverse (RegExes))
80-     if  (Regex->match (Query))
81-       Cb (/* FIXME: there is no users of this param yet  */   " " , LineNumber );
78+   for  (const  auto  &Regex : reverse (RegExes))
79+     if  (Regex->Rg . match (Query))
80+       Cb (Regex-> Name , Regex-> LineNo );
8281}
8382
8483//  TODO: Refactor this to return Expected<...>
0 commit comments