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

Fixes #31228 - Improve UUID check performance #8119

Merged
merged 1 commit into from Nov 1, 2020

Conversation

tbrisker
Copy link
Member

@tbrisker tbrisker commented Nov 1, 2020

Doing a full match for regexp including saving match data is slow when
all we care about is whether it is a UUID or not. Instead first rule out
quick checks (not a string, wrong length) and only then check with
.match? instead of =~ which just returns a boolean without saving
the match data.

Doing a full match for regexp including saving match data is slow when
all we care about is whether it is a UUID or not. Instead first rule out
quick checks (not a string, wrong length) and only then check with
`.match?` instead of `=~` which just returns a boolean without saving
the match data.
@theforeman-bot
Copy link
Member

Issues: #31228

@ekohl ekohl merged commit 4705d72 into theforeman:develop Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants