-
Notifications
You must be signed in to change notification settings - Fork 32
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
Replace search(s, t)
with something(findfirst(t, s), 0:-1)
#101
Conversation
Note: |
Codecov Report
@@ Coverage Diff @@
## master #101 +/- ##
==========================================
- Coverage 30.21% 28.86% -1.35%
==========================================
Files 4 4
Lines 1026 1150 +124
==========================================
+ Hits 310 332 +22
- Misses 716 818 +102
Continue to review full report at Codecov.
|
Should I go ahead and merge and tag then? |
Yeah that might be good. Then I can finish fixing WinRPM. |
These changes look good to me. I'll wait until CI and if they pass will merge and tag. |
@@ -22,7 +22,7 @@ wc = wrap_c.init( | |||
clang_extraargs, | |||
(th, h) -> | |||
begin | |||
if search(h, "expat") == 0:-1 | |||
if something(findfirst("expat", h), 0:-1) == 0:-1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, but it would be much more logical to write this instead:
if findfirst("expat", h) === nothing
You could even replace all this block with occursin("expat", h)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I just replaced it with the exact suggestion from the deprecation warning that Julia 0.7 gave me, just to make sure I didn't break anything.
The
search
function has been removed from Julia. (It was deprecated in Julia 0.7 and removed in Julia 1.0).This pull request replaces all uses of
search(s::AbstractString, t::AbstractString)
withsomething(findfirst(t, s), 0:-1)
.cc: @musm @vtjnash