Skip to content

Commit

Permalink
Avoid comparing findfirst to nothing (JuliaPlots#3200)
Browse files Browse the repository at this point in the history
  • Loading branch information
rikhuijzer authored Dec 23, 2020
1 parent 8f0d4c4 commit 0f349be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backends/gr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ gr_inqtext(x, y, s) = gr_inqtext(x, y, string(s))
function gr_inqtext(x, y, s::AbstractString)
if length(s) >= 2 && s[1] == '$' && s[end] == '$'
GR.inqmathtex(x, y, s[2:end-1])
elseif findfirst(isequal('\\'), s) !== nothing || occursin("10^{", s)
elseif occursin('\\', s) || occursin("10^{", s)
GR.inqtextext(x, y, s)
else
GR.inqtext(x, y, s)
Expand All @@ -231,7 +231,7 @@ gr_text(x, y, s) = gr_text(x, y, string(s))
function gr_text(x, y, s::AbstractString)
if length(s) >= 2 && s[1] == '$' && s[end] == '$'
GR.mathtex(x, y, s[2:end-1])
elseif findfirst(isequal('\\'), s) !== nothing || occursin("10^{", s)
elseif occursin('\\', s) || occursin("10^{", s)
GR.textext(x, y, s)
else
GR.text(x, y, s)
Expand Down

0 comments on commit 0f349be

Please sign in to comment.