Skip to content

Commit

Permalink
fixed index from length for a couple of cases (#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdiaz97 committed Oct 7, 2022
1 parent 9950e20 commit 749a0c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cookies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function parsecookievalue(raw, allowdoublequote::Bool)
if allowdoublequote && length(raw) > 1 && raw[1] == '"' && raw[end] == '"'
raw = raw[2:end-1]
end
for i = 1:length(raw)
for i = eachindex(raw)
!validcookievaluebyte(raw[i]) && return "", false
end
return raw, true
Expand Down
4 changes: 2 additions & 2 deletions src/sniff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ contenttype(e::Exact) = e.contenttype

function ismatch(e::Exact, data::CodeUnits, firstnonws)
length(data) < length(e.sig) && return false
for i = 1:length(e.sig)
for i = eachindex(e.sig)
e.sig[i] == data[i] || return false
end
return true
Expand Down Expand Up @@ -126,7 +126,7 @@ struct MP4Sig end
contenttype(::Type{MP4Sig}) = "video/mp4"

function byteequal(data1, ind, data2)
for i = 1:length(data2)
for i = eachindex(data2)
@inbounds data1[ind+i-1] == data2[i] || return false
end
return true
Expand Down

0 comments on commit 749a0c7

Please sign in to comment.