Skip to content

Commit

Permalink
Add explicit type cast in baggage UrlDecode (#1353)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan authored Apr 26, 2022
1 parent 33cb827 commit c917bed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/include/opentelemetry/baggage/baggage.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ class Baggage
};

auto from_hex = [](char c) -> char {
return std::isdigit(c) ? c - '0' : std::toupper(c) - 'A' + 10;
// c - '0' produces integer type which could trigger error/warning when casting to char,
// but the cast is safe here.
return static_cast<char>(std::isdigit(c) ? c - '0' : std::toupper(c) - 'A' + 10);
};

std::string ret;
Expand Down

2 comments on commit c917bed

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp sdk Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: c917bed Previous: 33cb827 Ratio
BM_BaselineBuffer/2 8067400.4554748535 ns/iter 2234018.087387085 ns/iter 3.61

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp api Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: c917bed Previous: 33cb827 Ratio
BM_ProcYieldSpinLockThrashing/2/process_time/real_time 1.0358111499107048 ms/iter 0.21307366339073996 ms/iter 4.86
BM_NaiveSpinLockThrashing/2/process_time/real_time 0.9965456969349097 ms/iter 0.21336656628233014 ms/iter 4.67

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.