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

Refactor get_key #189

Merged
merged 4 commits into from
Jun 8, 2017
Merged

Refactor get_key #189

merged 4 commits into from
Jun 8, 2017

Conversation

mptre
Copy link
Owner

@mptre mptre commented Jun 7, 2017

I had this diff laying around, finally took the time to split it up into several
commits. Thoughts and feedback are much appreciated.

mptre added 4 commits June 7, 2017 15:18
I find this a easier to read and less error-prone due to usage of
sizeof() instead of explicitly stating the length of the sequence.
Make sure to check the last read character prior reading a new one.
- Removes the need to validate the input buffer in get_choices()

- Returning an enum gives us nice compiler warnings if a new key type
  where to be added
@calleluks
Copy link
Collaborator

Hey @mptre, nice work! To me, the code reads better this way. Looks good to merge!

@mptre mptre merged commit 74aa733 into master Jun 8, 2017
@mptre mptre deleted the getkey branch June 8, 2017 16:02
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