Remove Redundant Parsing of Links (#4507)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2023-04-23 00:58:37 +02:00
committed by GitHub
parent f2938995c1
commit 95e7426283
10 changed files with 168 additions and 147 deletions
+2 -5
View File
@@ -24,7 +24,7 @@ static void BM_LinkParsing(benchmark::State &state)
// Make sure the TLDs are loaded
{
benchmark::DoNotOptimize(LinkParser("xd.com").getCaptured());
benchmark::DoNotOptimize(LinkParser("xd.com").result());
}
for (auto _ : state)
@@ -32,10 +32,7 @@ static void BM_LinkParsing(benchmark::State &state)
for (auto word : words)
{
LinkParser parser(word);
if (parser.hasMatch())
{
benchmark::DoNotOptimize(parser.getCaptured());
}
benchmark::DoNotOptimize(parser.result());
}
}
}