@@ -895,7 +895,7 @@ function getindex end
895
895
@eval getindex (A:: Array , i1:: Int ) = arrayref ($ (Expr (:boundscheck )), A, i1)
896
896
@eval getindex (A:: Array , i1:: Int , i2:: Int , I:: Int... ) = (@_inline_meta ; arrayref ($ (Expr (:boundscheck )), A, i1, i2, I... ))
897
897
898
- # Faster contiguous indexing using copyto! for UnitRange and Colon
898
+ # Faster contiguous indexing using copyto! for AbstractUnitRange and Colon
899
899
function getindex (A:: Array , I:: AbstractUnitRange{<:Integer} )
900
900
@_inline_meta
901
901
@boundscheck checkbounds (A, I)
@@ -955,7 +955,7 @@ function setindex!(A::Array, X::AbstractArray, I::AbstractVector{Int})
955
955
end
956
956
957
957
# Faster contiguous setindex! with copyto!
958
- function setindex! (A:: Array{T} , X:: Array{T} , I:: UnitRange {Int} ) where T
958
+ function setindex! (A:: Array{T} , X:: Array{T} , I:: AbstractUnitRange {Int} ) where T
959
959
@_inline_meta
960
960
@boundscheck checkbounds (A, I)
961
961
lI = length (I)
@@ -1455,7 +1455,7 @@ julia> deleteat!([6, 5, 4, 3, 2, 1], 2)
1455
1455
"""
1456
1456
deleteat! (a:: Vector , i:: Integer ) = (_deleteat! (a, i, 1 ); a)
1457
1457
1458
- function deleteat! (a:: Vector , r:: UnitRange {<:Integer} )
1458
+ function deleteat! (a:: Vector , r:: AbstractUnitRange {<:Integer} )
1459
1459
n = length (a)
1460
1460
isempty (r) || _deleteat! (a, first (r), length (r))
1461
1461
return a
@@ -1621,14 +1621,17 @@ Remove items at specified indices, and return a collection containing
1621
1621
the removed items.
1622
1622
Subsequent items are shifted left to fill the resulting gaps.
1623
1623
If specified, replacement values from an ordered collection will be spliced in
1624
- place of the removed items; in this case, `indices` must be a `UnitRange `.
1624
+ place of the removed items; in this case, `indices` must be a `AbstractUnitRange `.
1625
1625
1626
1626
To insert `replacement` before an index `n` without removing any items, use
1627
1627
`splice!(collection, n:n-1, replacement)`.
1628
1628
1629
1629
!!! compat "Julia 1.5"
1630
1630
Prior to Julia 1.5, `indices` must always be a `UnitRange`.
1631
1631
1632
+ !!! compat "Julia 1.8"
1633
+ Prior to Julia 1.8, `indices` must be a `UnitRange` if splicing in replacement values.
1634
+
1632
1635
# Examples
1633
1636
```jldoctest
1634
1637
julia> A = [-1, -2, -3, 5, 4, 3, -1]; splice!(A, 4:3, 2)
@@ -1646,7 +1649,7 @@ julia> A
1646
1649
-1
1647
1650
```
1648
1651
"""
1649
- function splice! (a:: Vector , r:: UnitRange {<:Integer} , ins= _default_splice)
1652
+ function splice! (a:: Vector , r:: AbstractUnitRange {<:Integer} , ins= _default_splice)
1650
1653
v = a[r]
1651
1654
m = length (ins)
1652
1655
if m == 0
0 commit comments