public void Dfa() { var httpContext = Requests[0]; var path = httpContext.Request.Path.Value; Span <PathSegment> segments = stackalloc PathSegment[SegmentCount]; var count = FastPathTokenizer.Tokenize(path, segments); var candidates = _dfa.FindCandidateSet(httpContext, path, segments.Slice(0, count)); var endpoint = candidates[0].Endpoint; Validate(Requests[0], Endpoints[0], endpoint); }
public void Dfa() { for (var i = 0; i < SampleCount; i++) { var sample = _samples[i]; var httpContext = Requests[sample]; var path = httpContext.Request.Path.Value; Span <PathSegment> segments = stackalloc PathSegment[FastPathTokenizer.DefaultSegmentCount]; var count = FastPathTokenizer.Tokenize(path, segments); var candidates = _dfa.FindCandidateSet(httpContext, path, segments.Slice(0, count)); var endpoint = candidates[0].Endpoint; Validate(httpContext, Endpoints[sample], endpoint); } }