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

chore: minor refactor for GetAttributes and UserMethods #561

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

TimothyMakkison
Copy link
Collaborator

@TimothyMakkison TimothyMakkison commented Jul 13, 2023

Refactor UserMethods and optimize GetAttributes

Description

  • Remove usage of Get<PreserveReferenceHandler>() from UserMethods, replace with a constant display string, simplifying logic and slightly improving memory usage (one less call to WellKnownType.Get).
  • Reorder logic in GetAttributes<T> to get the symbols attributes before retrieving the attribute type. This way if the symbol doesn't have any attributes the symbol doesn't have to be retrieved.

Checklist

  • The existing code style is followed
  • The commit message follows our guidelines
  • Performed a self-review of my code

@codecov
Copy link

codecov bot commented Jul 13, 2023

Codecov Report

Merging #561 (bcc710a) into main (85347e4) will decrease coverage by 0.60%.
The diff coverage is 90.07%.

@@            Coverage Diff             @@
##             main     #561      +/-   ##
==========================================
- Coverage   91.96%   91.37%   -0.60%     
==========================================
  Files         147      162      +15     
  Lines        4656     5517     +861     
  Branches      588      702     +114     
==========================================
+ Hits         4282     5041     +759     
- Misses        254      326      +72     
- Partials      120      150      +30     
Impacted Files Coverage Δ
src/Riok.Mapperly/Helpers/HashHelper.cs 0.00% <0.00%> (ø)
.../Riok.Mapperly/Helpers/NullableSymbolExtensions.cs 92.98% <0.00%> (-2.02%) ⬇️
...numerables/EnsureCapacity/EnsureCapacityBuilder.cs 45.94% <42.10%> (-32.32%) ⬇️
src/Riok.Mapperly/MapperResults.cs 50.00% <50.00%> (ø)
src/Riok.Mapperly/ImmutableEquatableArray.cs 54.54% <54.54%> (ø)
...ok.Mapperly/Configuration/AttributeDataAccessor.cs 68.88% <64.58%> (-7.93%) ⬇️
.../Descriptors/MappingBuilders/SpanMappingBuilder.cs 80.00% <80.00%> (ø)
...lders/NewInstanceObjectMemberMappingBodyBuilder.cs 80.00% <83.33%> (+1.21%) ⬆️
...scriptors/InlineExpressionMappingBuilderContext.cs 95.91% <85.71%> (+0.79%) ⬆️
src/Riok.Mapperly/MapperNode.cs 87.50% <87.50%> (ø)
... and 56 more

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@latonz latonz merged commit 85891cc into riok:main Jul 14, 2023
12 of 14 checks passed
@TimothyMakkison TimothyMakkison deleted the minor_opt_refactor branch July 14, 2023 19:23
@github-actions
Copy link

🎉 This PR is included in version 2.9.0-next.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Aug 7, 2023

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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