Skip to content

refactor: replace technology if-else chain with C++20 lookup table#349

Merged
knoepfel merged 5 commits intomainfrom
feature/wwu-form-refactor-cleanup
Feb 24, 2026
Merged

refactor: replace technology if-else chain with C++20 lookup table#349
knoepfel merged 5 commits intomainfrom
feature/wwu-form-refactor-cleanup

Conversation

@wwuoneway
Copy link
Copy Markdown
Contributor

Summary
This is a refactor and clean-up test to modernize the module registration logic.

Why

  • Cleaner Code: Replaced a verbose if-else block with a declarative std::unordered_map.
  • Modern Standards: Leveraged the project's C++20 configuration to use std::string_view for efficient, zero-allocation lookups.
  • Scalability: Makes it easier to add or modify supported technologies in the future without nesting more logic.

@wwuoneway wwuoneway self-assigned this Feb 22, 2026
@wwuoneway wwuoneway added the refactor refactor and/or cleanup label Feb 22, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 22, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
form/form_module.cpp 83.33% 0 Missing and 2 partials ⚠️
@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
+ Coverage   82.26%   82.43%   +0.16%     
==========================================
  Files         127      127              
  Lines        3102     3102              
  Branches      547      546       -1     
==========================================
+ Hits         2552     2557       +5     
+ Misses        333      328       -5     
  Partials      217      217              
Flag Coverage Δ
unittests 82.43% <83.33%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
form/form_module.cpp 89.13% <83.33%> (+8.69%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a26780a...9d5315e. Read the comment docs.

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

gemmeren
gemmeren previously approved these changes Feb 22, 2026
Copy link
Copy Markdown
Contributor

@gemmeren gemmeren left a comment

Choose a reason for hiding this comment

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

Thanks @wwuoneway , this looks good to me.

Copy link
Copy Markdown
Member

@knoepfel knoepfel left a comment

Choose a reason for hiding this comment

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

@wwuoneway, thanks for the PR. Just added a couple comments.

@knoepfel knoepfel merged commit df0443a into main Feb 24, 2026
53 checks passed
@knoepfel knoepfel deleted the feature/wwu-form-refactor-cleanup branch February 24, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor refactor and/or cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants