Skip to content
Snippets Groups Projects

Simplified return

Merged Philip Müller requested to merge maitesin:master into master

Created by: maitesin

I just simplified a return, but...

I would like to change the if ... else nested statements from line 108 into a switch case statement. As the key will be a string I should need to use constexpr feature from C++11 like in http://dev.krzaq.cc/switch-on-strings-with-c11/

Merge request reports

Approval is optional

Merged by avatar (Mar 14, 2025 5:20am UTC)

Merge details

  • Changes merged into master with e2fdd29a (commits were squashed).
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Created by: december0123

    Thanks. I reckon there's still a lot of code like this that needs simplifying. As for the switch statement, as long as it's readable and doesn't introduce code clutter it's fine by me. If you wish to try, there are other places with long if-else chains (like Mhwd::tryToParseCmdLineOptions).

  • Created by: maitesin

    I am glad to help. Yeah, sure. I will work on that from tomorrow on and I will do a pull request as soon as I have something good.

Please register or sign in to reply
Loading