Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse options without names vector #88

Merged
merged 1 commit into from
Aug 19, 2019

Conversation

jridgewell
Copy link
Contributor

The only time the names vector has more than one Name in it is when parsing contiguous short options (-abc). We would continue putting Names into the vector until we hit a short option that takes an argument. At that point, we break, so we can process the argument.

So there's no point to reprocess the head of that vector, we already know they don't take arguments. Only the last one matters.

This relands #81, which was reverted in #84. It's not a breaking change, purely an optimization.
/cc @alexcrichton

The only time the names vector has more than one `Name` in it is when parsing contiguous short options (`-abc`). We would continue putting `Name`s into the vector until we hit a short option that takes an argument. At that point, we break, so we can process the argument.

So there's no point to reprocess the head of that vector, we already know they don't take arguments. Only the last one matters.
@alexcrichton
Copy link
Member

Thanks! Sorry for the difficulties here!

@alexcrichton alexcrichton merged commit ded6c8e into rust-lang:master Aug 19, 2019
@jridgewell
Copy link
Contributor Author

All good.

@jridgewell jridgewell deleted the parse_without_vec branch August 19, 2019 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants