Skip to content

Commit

Permalink
Update to_ascii.cpp
Browse files Browse the repository at this point in the history
Typo
  • Loading branch information
lemire authored Apr 13, 2023
1 parent 1dcb947 commit 06714ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benchmarks/to_ascii.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ BENCHMARK(Ada);
#if ICU_AVAILABLE

// returns empty string on error
std::string icu_to_array(std::string_view input) {
std::string icu_to_ascii(std::string_view input) {
static std::string error = "";

std::string out(255, 0);
Expand Down Expand Up @@ -153,7 +153,7 @@ std::string icu_to_array(std::string_view input) {
static void Icu(benchmark::State& state) {
for (auto _ : state) {
for (std::string& url_string : inputs) {
benchmark::DoNotOptimize(icu_to_array(url_string));
benchmark::DoNotOptimize(icu_to_ascii(url_string));
}
}

Expand All @@ -163,7 +163,7 @@ static void Icu(benchmark::State& state) {
std::atomic_thread_fence(std::memory_order_acquire);
collector.start();
for (std::string& url_string : inputs) {
benchmark::DoNotOptimize(icu_to_array(url_string));
benchmark::DoNotOptimize(icu_to_ascii(url_string));
}
std::atomic_thread_fence(std::memory_order_release);
event_count allocate_count = collector.end();
Expand Down Expand Up @@ -200,7 +200,7 @@ BENCHMARK(Icu);
bool verify() {
bool is_ok = true;
for (std::string& url_string : inputs) {
std::string icu_answer = icu_to_array(url_string);
std::string icu_answer = icu_to_ascii(url_string);
std::string ada_answer = ada::idna::to_ascii(url_string);
if (icu_answer != ada_answer) {
std::cerr << " ada/icu mismatch " << ada_answer << " vs. " << icu_answer
Expand Down

0 comments on commit 06714ea

Please sign in to comment.