/// <summary>
/// In a single thread loops through the useragents in the file
/// provided perform a match with the data set provided passing
/// control back to the method provided for further processing.
/// </summary>
/// <param name="provider"></param>
/// <param name="userAgents"></param>
/// <param name="method"></param>
/// <returns>Counts for each of the methods used</returns>
internal static Results DetectLoopSingleThreaded(Provider provider, IEnumerable<string> userAgents, ProcessMatch method, object state)
{
provider.DataSet.ResetCache();
var match = provider.CreateMatch();
var results = new Results();
foreach (var line in userAgents)
{
provider.Match(line.Trim(), match);
method(results, match, state);
results.Count++;
results.Methods[match.Method]++;
}
AssertPool(provider);
ReportMethods(results.Methods);
ReportProvider(provider);
ReportTime(results);
return results;
}