René's URL Explorer Experiment


Title: file: rework saving and loading for correctness and to avoid copying by iscgar · Pull Request #1538 · solvespace/solvespace · GitHub

Open Graph Title: file: rework saving and loading for correctness and to avoid copying by iscgar · Pull Request #1538 · solvespace/solvespace

X Title: file: rework saving and loading for correctness and to avoid copying by iscgar · Pull Request #1538 · solvespace/solvespace

Description: Rework the object attributes to avoid needlessly iterating over all of them when needing to save a specific object or load a specific attribute of an object. While at it, add type verification for member serialisation. This caught an issue with the Group::forceToMesh member, which was incorrectly serialised as an int, rather than as a bool. Thankfully this didn't overwrite the next member because there are padding bytes in between, but we shouldn't continue to rely on this broken behaviour. However, this change unfortunately breaks the tests, since the save logic skips int members which are set to 0, but not boolean members which are set to false. This now causes the Group::forceToMesh member to be emitted into the file where it previously wasn't. If we add the same logic to boolean as well, this would still break the tests because other boolean values were previously serialised. So we need to update the tests either way, but I'm not sure if I should just change the existing files, or back them up with _v31 added to their name, like the other ones which have _v20 and _v21. @ruevs, @phkahler please advise on the way to do it, and if I should change the boolean serialisation logic to match the one used for ints, and skip members set to false. Also change the file saving logic so that it doesn't have to go through the sv member of SolveSpaceUI, which needlessly requires copying objects over and over. This leaves sv to be used only as a temporary during file loading, but there's no reason to keep it as a member for this, so it is now made a local variable in the two functions that need it.

Open Graph Description: Rework the object attributes to avoid needlessly iterating over all of them when needing to save a specific object or load a specific attribute of an object. While at it, add type verification for ...

X Description: Rework the object attributes to avoid needlessly iterating over all of them when needing to save a specific object or load a specific attribute of an object. While at it, add type verification for ...

Opengraph URL: https://github.com/solvespace/solvespace/pull/1538

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:45c9650f-15af-56d4-7bf4-66dec28885c9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB05E:343EA:1795B91:1FE2C32:696EADA7
html-safe-nonce0a62b95e98f2c346144aff078377f6058d5f184bd330da8df1e1115ddf59221b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDVFOjM0M0VBOjE3OTVCOTE6MUZFMkMzMjo2OTZFQURBNyIsInZpc2l0b3JfaWQiOiI4MjEzMzc5NTMzNzI5ODY5MjIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac065a2349e3ea5aae6dc413982d169267b94769e052e56084a8f4e8943fcfa803
hovercard-subject-tagpull_request:2366342815
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/solvespace/solvespace/pull/1538/files
twitter:imagehttps://avatars.githubusercontent.com/u/1956576?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1956576?s=400&v=4
og:image:altRework the object attributes to avoid needlessly iterating over all of them when needing to save a specific object or load a specific attribute of an object. While at it, add type verification for ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/solvespace/solvespace git https://github.com/solvespace/solvespace.git
octolytics-dimension-user_id18541596
octolytics-dimension-user_loginsolvespace
octolytics-dimension-repository_id32905910
octolytics-dimension-repository_nwosolvespace/solvespace
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id32905910
octolytics-dimension-repository_network_root_nwosolvespace/solvespace
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release39aed5006635ab6f45e6b77d23e73b08a00272a3
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsolvespace%2Fsolvespace%2Fpull%2F1538%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsolvespace%2Fsolvespace%2Fpull%2F1538%2Ffiles
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=solvespace%2Fsolvespace
Reloadhttps://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files
Reloadhttps://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files
Reloadhttps://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files
solvespace https://patch-diff.githubusercontent.com/solvespace
solvespacehttps://patch-diff.githubusercontent.com/solvespace/solvespace
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fsolvespace%2Fsolvespace
Fork 541 https://patch-diff.githubusercontent.com/login?return_to=%2Fsolvespace%2Fsolvespace
Star 3.7k https://patch-diff.githubusercontent.com/login?return_to=%2Fsolvespace%2Fsolvespace
Code https://patch-diff.githubusercontent.com/solvespace/solvespace
Issues 262 https://patch-diff.githubusercontent.com/solvespace/solvespace/issues
Pull requests 27 https://patch-diff.githubusercontent.com/solvespace/solvespace/pulls
Actions https://patch-diff.githubusercontent.com/solvespace/solvespace/actions
Projects 0 https://patch-diff.githubusercontent.com/solvespace/solvespace/projects
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/solvespace/solvespace/security
Please reload this pagehttps://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files
Insights https://patch-diff.githubusercontent.com/solvespace/solvespace/pulse
Code https://patch-diff.githubusercontent.com/solvespace/solvespace
Issues https://patch-diff.githubusercontent.com/solvespace/solvespace/issues
Pull requests https://patch-diff.githubusercontent.com/solvespace/solvespace/pulls
Actions https://patch-diff.githubusercontent.com/solvespace/solvespace/actions
Projects https://patch-diff.githubusercontent.com/solvespace/solvespace/projects
Security https://patch-diff.githubusercontent.com/solvespace/solvespace/security
Insights https://patch-diff.githubusercontent.com/solvespace/solvespace/pulse
Sign up for GitHub https://patch-diff.githubusercontent.com/signup?return_to=%2Fsolvespace%2Fsolvespace%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2Fsolvespace%2Fsolvespace%2Fissues%2Fnew%2Fchoose
iscgarhttps://patch-diff.githubusercontent.com/iscgar
solvespace:masterhttps://patch-diff.githubusercontent.com/solvespace/solvespace/tree/master
iscgar:iscgar/file-cleanuphttps://patch-diff.githubusercontent.com/iscgar/solvespace/tree/iscgar/file-cleanup
Conversation 3 https://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538
Commits 1 https://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/commits
Checks 4 https://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/checks
Files changed https://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files
Please reload this pagehttps://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files
file: rework saving and loading for correctness and to avoid copying https://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files#top
Show all changes 1 commit https://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files
88f79ea file: rework saving and loading for correctness and to avoid copying Feb 24, 2025 https://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/commits/88f79eaeaad59bfa14c41c36b0c30086e3c9bd23
Clear filters https://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files
Please reload this pagehttps://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files
Please reload this pagehttps://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files
file.cpp https://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files#diff-9e745654ed2473715bfbd2ce31ca79ceaa10a8235a06bd9144b27a68e2aebfea
solvespace.h https://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files#diff-8712b70336e60e6bc2d3c49a0793e048d54d99fadbd1bcb3c598a5ec21e6eec3
harness.cpp https://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files#diff-4d90961d74f737ba868bc9a5c7086e317df6058d6b7d387694763f53a0813322
Please reload this pagehttps://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files
Please reload this pagehttps://patch-diff.githubusercontent.com/solvespace/solvespace/pull/1538/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.