tool_getparam: cmdline option parser refactor#12631
Closed
Conversation
Member
Author
|
The most relevant speed tests I did with a manually added loop around the |
d31e529 to
d720a56
Compare
99113fd to
f10fc64
Compare
cfa4bf7 to
720cc04
Compare
bagder
added a commit
that referenced
this pull request
Jan 7, 2024
- the option names are now alpha sorted and lookup is a lot faster - use case sensitive matching. It was previously case insensitive, but that was not documented nor tested. - remove "partial match" feature. It was not documented, not tested and was always fragile as existing use could break when we add a new option - lookup short options via a table Closes #12631
720cc04 to
c1c908d
Compare
- the option names are now alpha sorted and lookup is a lot faster - use case sensitive matching. It was previously case insensitive, but that was not documented nor tested. - remove "partial match" feature. It was not documented, not tested and was always fragile as existing use could break when we add a new option - lookup short options via a table Closes #12631
- easier to follow, easier to modify, easier to extend, possibly slightly faster - each case now has the long option as a comment
This function is not doing post at all so it was always weirdly placed.
use aprintf() instead
Saves ~11 bytes per option and simplifies the code.
To make the big switch much easier to read/understand and to make it easier to add new options.
c1c908d to
a725ab6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the option names are now alpha sorted and lookup is a lot faster
use case sensitive matching. It was previously case insensitive, but that was not documented nor tested.
remove "partial match" feature. It was not documented, not tested and was always fragile as existing use could break when we add a new option
lookup short options via a table