MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / SearchDFA

Function SearchDFA

extern/re2/re2/testing/regexp_benchmark.cc:848–864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

846// Anchored says whether to run an anchored search.
847
848void SearchDFA(benchmark::State& state, const char* regexp,
849 const StringPiece& text, Prog::Anchor anchor,
850 bool expect_match) {
851 for (auto _ : state) {
852 Regexp* re = Regexp::Parse(regexp, Regexp::LikePerl, NULL);
853 CHECK(re);
854 Prog* prog = re->CompileToProg(0);
855 CHECK(prog);
856 bool failed = false;
857 CHECK_EQ(prog->SearchDFA(text, StringPiece(), anchor, Prog::kFirstMatch,
858 NULL, &failed, NULL),
859 expect_match);
860 CHECK(!failed);
861 delete prog;
862 re->Decref();
863 }
864}
865
866void SearchNFA(benchmark::State& state, const char* regexp,
867 const StringPiece& text, Prog::Anchor anchor,

Callers

nothing calls this directly

Calls 5

ParseFunction · 0.85
StringPieceClass · 0.85
CompileToProgMethod · 0.80
SearchDFAMethod · 0.80
DecrefMethod · 0.45

Tested by

no test coverage detected