Simplified return #93

Merged
philm merged 1 commit from unknown repository into master 2015-08-12 23:19:46 +00:00
philm commented 2015-08-12 18:46:20 +00:00 (Migrated from gitlab2.manjaro.org)

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/

*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 <b>constexpr</b> feature from C++11 like in http://dev.krzaq.cc/switch-on-strings-with-c11/
philm commented 2015-08-12 19:03:35 +00:00 (Migrated from gitlab2.manjaro.org)

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: 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](https://github.com/manjaro/mhwd/blob/master/src/Mhwd.cpp#L678)).
philm commented 2015-08-12 19:15:33 +00:00 (Migrated from gitlab2.manjaro.org)

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.

*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.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
applications/mhwd!93
No description provided.