[solc] Refactor valid input modes. - #13577
Conversation
| if ( | ||
| m_options.input.mode == InputMode::Help || | ||
| m_options.input.mode == InputMode::License || | ||
| m_options.input.mode == InputMode::Version | ||
| ) | ||
| if (std::set<InputMode>{InputMode::Help, InputMode::License, InputMode::Version}.count(m_options.input.mode) == 1) |
There was a problem hiding this comment.
To be honest, I think the previous version was much more readable even though it was less concise :)
There was a problem hiding this comment.
We'll get set::contains when™ we upgrade to c++20 :)
There was a problem hiding this comment.
We have our own version in CommonData.h.
But it would still look pretty much the same. Not a big deal, just pointing out that sometimes the stupid way to do it is cleaner :)
|
|
||
| void CommandLineInterface::readInputFiles() | ||
| { | ||
| solAssert(!m_standardJsonInput.has_value(), ""); |
There was a problem hiding this comment.
Just curious because I've seen it all over the place - is this equivalent to your altered version where you don't pass ""? I.e. will this just terminate with an empty message?
There was a problem hiding this comment.
Yep, this is equivalent to an empty message.
There was a problem hiding this comment.
Until quite recently you could not skip the message (#12019). And it's just a tiny detail, so I don't think it makes sense to spend time replacing it all everywhere. We just sometimes remove the empty messages when we clean up code.
199ed76 to
cd440fc
Compare
Refactors
solc/CommandLineInterface.cppto make #12834 more readable.