Skip to content

Commit

Permalink
Drop compat code for replace with a pair from #445
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 4, 2019
1 parent 5edbeeb commit 5c47af7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ Currently, the `@compat` macro supports the following syntaxes:
* `@compat finalizer(func, obj)` with the finalizer to run as the first argument and the object to be finalized
as the second ([#24605]).

* `replace` accepts a pair of pattern and replacement, with the number of replacements as
a keyword argument ([#25165]).

* `CartesianIndices` and `LinearIndices` types represent cartesian and linear indices of
an array (respectively), and indexing such objects allows translating from one kind of index
to the other ([#25113]).
Expand Down
5 changes: 0 additions & 5 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ end
end
end

@static if VERSION < v"0.7.0-DEV.3172"
Base.replace(s::AbstractString, pat_rep::Pair; count::Integer=typemax(Int)) =
replace(s, first(pat_rep), last(pat_rep), count)
end

# 0.7.0-DEV.3057
@static if !isdefined(Base, :copyto!)
const copyto! = Base.copy!
Expand Down
4 changes: 4 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -601,3 +601,7 @@ end

# 0.7.0-DEV.3173
@test invpermute!(permute!([1, 2], 2:-1:1), 2:-1:1) == [1, 2]

# 0.7.0-DEV.3172
@test replace("abcb", "b"=>"c") == "accc"
@test replace("abcb", "b"=>"c", count=1) == "accb"
4 changes: 0 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ let A = [0, 0, 0], B = [1, 2, 3]
@test unsafe_copyto!(A, 2, B, 1, 1) === A == [0, 1, 0]
end

# 0.7.0-DEV.3172
@test replace("abcb", "b"=>"c") == "accc"
@test replace("abcb", "b"=>"c", count=1) == "accb"

# 0.7.0-DEV.3025
let c = CartesianIndices((1:3, 1:2)), l = LinearIndices((1:3, 1:2))
@test LinearIndices(c) == collect(l)
Expand Down

0 comments on commit 5c47af7

Please sign in to comment.