Skip to content

Commit

Permalink
improve TODO notes (StefanKarpinski)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet committed Jun 21, 2017
1 parent 1eb7718 commit d271b78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1485,8 +1485,11 @@ end
using .DSP
export conv, conv2, deconv, filt, filt!, xcorr

# NOTE: rename the function replace_new from strings/util.jl to replace
# when this replace is removed from deprecated.jl
# PR #22325
# TODO: when this replace is removed from deprecated.jl:
# 1) rename the function replace_new from strings/util.jl to replace
# 2) update the replace(s::AbstractString, pat, f) method, below replace_new
# (see instructions there)
function replace(s::AbstractString, pat, f, n::Integer)
if n <= 0
depwarn(string("`replace(s, pat, r, count)` with `count <= 0` is deprecated, use ",
Expand Down
4 changes: 2 additions & 2 deletions base/strings/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ _replace(io, repl, str, r, pattern) = print(io, repl)
_replace(io, repl::Function, str, r, pattern) =
print(io, repl(SubString(str, first(r), last(r))))

# TODO: rename to `replace` when `replace` is removed from deprecated.jl
function replace_new(str::String, pattern, repl, count::Integer)
# rename to `replace` when `replace` is removed from deprecated.jl
count == 0 && return str
count < 0 && throw(DomainError())
n = 1
Expand Down Expand Up @@ -405,7 +405,7 @@ If `pat` is a regular expression and `r` is a `SubstitutionString`, then capture
references in `r` are replaced with the corresponding matched text.
"""
replace(s::AbstractString, pat, f) = replace_new(String(s), pat, f, typemax(Int))
# change this to the following when `replace` is removed from deprecated:
# TODO: change this to the following when `replace` is removed from deprecated.jl:
# replace(s::AbstractString, pat, f, count::Integer=typemax(Int)) =
# replace(String(s), pat, f, count)

Expand Down

0 comments on commit d271b78

Please sign in to comment.