Skip to content

Commit

Permalink
Merge pull request #253 from JuliaText/as/write_sub
Browse files Browse the repository at this point in the history
remove `write_sub`
  • Loading branch information
aviks authored Apr 5, 2021
2 parents 674200c + 4080202 commit 426cba4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/preprocessing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -480,18 +480,18 @@ function remove_patterns(s::SubString{T}, rex::Regex) where T <: String
data = codeunits(s.string)
ibegin = 1
for m in eachmatch(rex, s)
len = m.match.offset-ibegin+1
len = m.match.offset-ibegin
next = nextind(s, lastindex(m.match)+m.match.offset)
if len > 0
Base.write_sub(iob, data, ibegin+ioffset, len)
write(iob, SubString(s, ibegin, ibegin+len))
if next != length(s)+1
write(iob, ' ')
end
end
ibegin = next
end
len = lastindex(s) - ibegin + 1
(len > 0) && Base.write_sub(iob, data, ibegin+ioffset, len)
len = lastindex(s) - ibegin
(len > 0) && write(iob, SubString(s, ibegin, ibegin+len))
String(take!(iob))
end

Expand Down

0 comments on commit 426cba4

Please sign in to comment.