Skip to content

Commit

Permalink
Remove fpclassify calls since the value is now an integer and not flo…
Browse files Browse the repository at this point in the history
…ating point
  • Loading branch information
zacharycmontoya committed Oct 4, 2024
1 parent d059561 commit ef43ce3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 1 addition & 5 deletions src/datadog/span_sampler_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,8 @@ Expected<FinalizedSpanSamplerConfig> finalize_config(
return error->with_prefix(prefix);
}

const auto allowed_types = {FP_NORMAL, FP_SUBNORMAL};
if (rule.max_per_second &&
(!(*rule.max_per_second > 0) ||
std::find(std::begin(allowed_types), std::end(allowed_types),
std::fpclassify(*rule.max_per_second)) ==
std::end(allowed_types))) {
(!(*rule.max_per_second > 0))) {
std::string message;
message += "Span sampling rule with pattern ";
message += nlohmann::json(static_cast<SpanMatcher>(rule)).dump();
Expand Down
4 changes: 1 addition & 3 deletions src/datadog/trace_sampler_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@ Expected<FinalizedTraceSamplerConfig> finalize_config(
ConfigName::TRACE_SAMPLING_LIMIT, std::to_string(max_per_second), origin);

const auto allowed_types = {FP_NORMAL, FP_SUBNORMAL};
if (!(max_per_second > 0) ||
std::find(std::begin(allowed_types), std::end(allowed_types),
std::fpclassify(max_per_second)) == std::end(allowed_types)) {
if (!(max_per_second > 0)) {
std::string message;
message +=
"Trace sampling max_per_second must be greater than zero, but the "
Expand Down

0 comments on commit ef43ce3

Please sign in to comment.