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

Factoring out String length check. #23

Merged
merged 4 commits into from
May 18, 2014
Merged

Conversation

omaciel
Copy link
Owner

@omaciel omaciel commented May 17, 2014

All string generating methods were performing the same check for the
type and value of the length argument. I have created a new
is_valid_length method that removes the redundant code and seems to
speed up tests ten-fold.

All string generating methods were performing the same check for the
type and value of the ``length`` argument. I have created a new
``is_valid_length`` method that removes the redundant code and seems to
speed up tests ten-fold.
@omaciel omaciel mentioned this pull request May 17, 2014
Also use it to perform a validation check in `generate_iplum`.
@Ichimonji10
Copy link
Contributor

Great set of changes.

I've created a pull request with some additional, fairly minor tweaks on top of your work. I've renamed is_valid_length to is_positive_int and refactored out a duplicate validation check.

The only thing I'm iffy about is the formatting used in method generate_utf8. But... eh. Minor.

omaciel added a commit that referenced this pull request May 18, 2014
Factoring out String length check.
@omaciel omaciel merged commit 24ec077 into master May 18, 2014
@omaciel omaciel deleted the refactor-string-length branch May 18, 2014 22:35
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.

None yet

2 participants