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

Dissolve schema query into distinct ToDataTable paths #1007

Merged

Conversation

atifaziz
Copy link
Member

This is a refactoring PR that improves ToDataTable.

The internal BuildOrBindSchema method created a schema projection (schemas), but the two paths taken by the code (based on whether the table had columns) accessed distinct parts of the projection. This PR removes the query to save on allocation costs, moves the only shared bit into a new local function called GetElementaryTypeOfPropertyOrField and the rest is dissolved into each code path.

@atifaziz atifaziz added this to the 4.0 milestone Jun 25, 2023
@atifaziz atifaziz self-assigned this Jun 25, 2023
@codecov
Copy link

codecov bot commented Jun 25, 2023

Codecov Report

Merging #1007 (0f599d6) into master (f766827) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head 0f599d6 differs from pull request most recent head b9c3062. Consider uploading reports for the commit b9c3062 to get more accurate results

@@            Coverage Diff             @@
##           master    #1007      +/-   ##
==========================================
- Coverage   92.59%   92.57%   -0.02%     
==========================================
  Files         113      113              
  Lines        3430     3422       -8     
  Branches     1054     1055       +1     
==========================================
- Hits         3176     3168       -8     
  Misses        191      191              
  Partials       63       63              
Impacted Files Coverage Δ
MoreLinq/ToDataTable.cs 96.51% <100.00%> (-0.30%) ⬇️

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

@atifaziz atifaziz merged commit b9c3062 into morelinq:master Jun 25, 2023
@atifaziz atifaziz removed this from the 4.0 milestone Jun 25, 2023
@atifaziz atifaziz deleted the refac/ToDataTable/distinct-schema-paths branch June 25, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant