Skip to content

refactor: rename to Quantity.DefaultProvider.Quantities #1576

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

Merged
merged 4 commits into from
Jul 25, 2025

Conversation

angularsen
Copy link
Owner

Fixup of #1555

@angularsen angularsen requested a review from lipchev July 25, 2025 17:57
@angularsen
Copy link
Owner Author

Optionally merge #1575 first, this PR has both changes.

@angularsen angularsen changed the title refactor: change DefaultQuantities to use property initializer refactor: rename to Quantity.DefaultProvider.Quantities, use property initializer Jul 25, 2025
@angularsen angularsen changed the title refactor: rename to Quantity.DefaultProvider.Quantities, use property initializer refactor: rename to Quantity.DefaultProvider.Quantities Jul 25, 2025
Copy link

codecov bot commented Jul 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93%. Comparing base (77ada0e) to head (a43ed47).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1576   +/-   ##
======================================
  Coverage      93%     93%           
======================================
  Files         311     311           
  Lines       28780   28781    +1     
======================================
+ Hits        26863   26864    +1     
  Misses       1917    1917           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -23,7 +23,7 @@ namespace UnitsNet;
/// </remarks>
internal class QuantityInfoLookup
{
private readonly QuantityInfo[] _quantities;
private readonly IReadOnlyList<QuantityInfo> _quantities;
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is a slight performance overhead of using the interface on the private field, but if you prefer clarity- it's fine by me..

Copy link
Owner Author

Choose a reason for hiding this comment

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

This change was collateral damage, I'll revert it. The idea was to accept IReadOnlyList as input and reuse instance if compatible, but I'll do the same for array instead.

@lipchev
Copy link
Collaborator

lipchev commented Jul 25, 2025

Ok, i'm fine with the static initializer- we'll change it back when we start actually configuring the defaults..

@lipchev lipchev merged commit d21e526 into master Jul 25, 2025
3 checks passed
@lipchev lipchev deleted the agl/rename-defaultprovider branch July 25, 2025 19:40
@angularsen
Copy link
Owner Author

Sounds good

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