Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Exporter.Prometheus] remove redundant if in WriteUnicodeNoEscape #6077

Conversation

SimonCropp
Copy link
Contributor

Fixes #
Design discussion issue #

Changes

0x07FF is 2047
0xFFFF is 65535

Since there is ordinal <= 0x07FF check before the ordinal <= 0xFFFF then the ordinal <= 0xFFFF confition is always true

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@SimonCropp SimonCropp requested a review from a team as a code owner January 20, 2025 11:44
@github-actions github-actions bot added the pkg:OpenTelemetry.Exporter.Prometheus.HttpListener Issues related to OpenTelemetry.Exporter.Prometheus.HttpListener NuGet package label Jan 20, 2025
@Kielek Kielek changed the title remove redundant if in WriteUnicodeNoEscape [Exporter.Prometheus] remove redundant if in WriteUnicodeNoEscape Jan 22, 2025
Copy link
Contributor

@Kielek Kielek left a comment

Choose a reason for hiding this comment

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

Technically, the change is correct. Maybe it is worth to add some comment about boundaries?

@CodeBlanch CodeBlanch merged commit b508b84 into open-telemetry:main Jan 24, 2025
39 checks passed
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.40%. Comparing base (275a446) to head (935cb4e).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #6077   +/-   ##
=======================================
  Coverage   86.39%   86.40%           
=======================================
  Files         257      257           
  Lines       11650    11649    -1     
=======================================
  Hits        10065    10065           
+ Misses       1585     1584    -1     
Files with missing lines Coverage Δ
...heus.HttpListener/Internal/PrometheusSerializer.cs 87.64% <ø> (+0.48%) ⬆️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:OpenTelemetry.Exporter.Prometheus.HttpListener Issues related to OpenTelemetry.Exporter.Prometheus.HttpListener NuGet package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants