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

refactor(otlp-exporter-base): remove unnecessary isNaN() checks #5374

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Jan 26, 2025

Which problem is this PR solving?

This PR removes validation code that is not needed.

Fixes N/A

Short description of the changes

This commit removes two Number.isNaN() checks. These checks are not needed because the Number.isFinite() checks they are paired with also detect NaN values.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Ran the existing test suite which includes NaN tests for one of the checks.
  • Added unit tests for the other NaN check that did not appear to be tested.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added

@cjihrig cjihrig requested a review from a team as a code owner January 26, 2025 02:16
This commit removes two Number.isNaN() checks. These checks are
not needed because the Number.isFinite() checks they are paired
with also detect NaN values.
Copy link

codecov bot commented Jan 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.54%. Comparing base (f927e82) to head (8167313).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5374      +/-   ##
==========================================
- Coverage   94.54%   94.54%   -0.01%     
==========================================
  Files         318      318              
  Lines        8052     8046       -6     
  Branches     1694     1688       -6     
==========================================
- Hits         7613     7607       -6     
  Misses        439      439              
Files with missing lines Coverage Δ
...ter-base/src/configuration/shared-configuration.ts 100.00% <100.00%> (ø)
...base/src/configuration/shared-env-configuration.ts 100.00% <100.00%> (ø)

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

thanks 👍

@pichlermarc pichlermarc added this pull request to the merge queue Jan 27, 2025
Merged via the queue into open-telemetry:main with commit 3e013cf Jan 27, 2025
15 checks passed
@cjihrig cjihrig deleted the is-nan branch January 27, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants