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 LLVM.default_target_triple to avoid regex #13659

Merged

Conversation

straight-shoota
Copy link
Member

There's no need to use regex for matching plain strings in LLVM.default_target_triple.
I replaced it with String#starts_with?. The functional equivalent would've been #includes? but as far as I am aware, the target triple always starts with the arch so this there should never be anything before these search strings.

spec/std/llvm/llvm_spec.cr Outdated Show resolved Hide resolved
spec/std/llvm/llvm_spec.cr Outdated Show resolved Hide resolved
Co-authored-by: Quinton Miller <nicetas.c@gmail.com>
@straight-shoota straight-shoota added this to the 1.10.0 milestone Jul 24, 2023
@beta-ziliani beta-ziliani merged commit ba5c634 into master Aug 1, 2023
105 checks passed
@beta-ziliani beta-ziliani deleted the refactor/remove-regex-llvm.default_target_triple branch August 1, 2023 14:38
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
)

There's no need to use regex for matching plain strings in LLVM.default_target_triple.
I replaced it with String#starts_with?. The functional equivalent would've been #includes? but as far as I am aware, the target triple always starts with the arch so this there should never be anything before these search strings.

Co-authored-by: Quinton Miller <nicetas.c@gmail.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants