Skip to content

Commit

Permalink
Replace various instances of Array with Vector. (#21645)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacha0 authored and ararslan committed Apr 30, 2017
1 parent da69be2 commit 46551cd
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion base/Enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ macro enum(T,syms...)
elseif !isa(T,Symbol)
throw(ArgumentError("invalid type expression for enum $T"))
end
vals = Array{Tuple{Symbol,Integer}}(0)
vals = Vector{Tuple{Symbol,Integer}}(0)
lo = hi = 0
i = zero(basetype)
hasexpr = false
Expand Down
2 changes: 1 addition & 1 deletion base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ Read at most `nb` bytes from `s`, returning a `Vector{UInt8}` of the bytes read.
function read(s::IO, nb=typemax(Int))
# Let readbytes! grow the array progressively by default
# instead of taking of risk of over-allocating
b = Array{UInt8}(nb == typemax(Int) ? 1024 : nb)
b = Vector{UInt8}(nb == typemax(Int) ? 1024 : nb)
nr = readbytes!(s, b, nb)
return resize!(b, nr)
end
Expand Down
2 changes: 1 addition & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ elseif is_apple()
path_basename = String(basename(path))
local casepreserved_basename
const header_size = 12
buf = Array{UInt8}(length(path_basename) + header_size + 1)
buf = Vector{UInt8}(length(path_basename) + header_size + 1)
while true
ret = ccall(:getattrlist, Cint,
(Cstring, Ptr{Void}, Ptr{Void}, Csize_t, Culong),
Expand Down
4 changes: 2 additions & 2 deletions base/pkg/resolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function sanity_check(deps::Dict{String,Dict{VersionNumber,Available}},
end
end

vers = Array{Tuple{String,VersionNumber,VersionNumber}}(0)
vers = Vector{Tuple{String,VersionNumber,VersionNumber}}(0)
for (p,d) in deps, vn in keys(d)
lvns = VersionNumber[Iterators.filter(vn2->(vn2>vn), keys(d))...]
nvn = isempty(lvns) ? typemax(VersionNumber) : minimum(lvns)
Expand All @@ -88,7 +88,7 @@ function sanity_check(deps::Dict{String,Dict{VersionNumber,Available}},

checked = falses(nv)

problematic = Array{Tuple{String,VersionNumber,String}}(0)
problematic = Vector{Tuple{String,VersionNumber,String}}(0)
i = 1
psl = 0
for (p,vn,nvn) in vers
Expand Down
2 changes: 1 addition & 1 deletion base/pkg/resolve/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function enforce_optimality!(sol::Vector{Int}, interface::Interface)

# prepare some useful structures
# pdeps[p0][v0] has all dependencies of package p0 version v0
pdeps = [Array{Requires}(spp[p0]-1) for p0 = 1:np]
pdeps = [Vector{Requires}(spp[p0]-1) for p0 = 1:np]
# prevdeps[p1][p0][v0] is the VersionSet of package p1 which package p0 version v0
# depends upon
prevdeps = [Dict{Int,Dict{Int,VersionSet}}() for p0 = 1:np]
Expand Down
2 changes: 1 addition & 1 deletion base/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ else
limbs::Vector{Limb} # buffer to be copied into generated BigInt's
mask::Limb # applied to the highest limb

RangeGeneratorBigInt(a, m, nlimbs, mask) = new(a, m, Array{Limb}(nlimbs), mask)
RangeGeneratorBigInt(a, m, nlimbs, mask) = new(a, m, Vector{Limb}(nlimbs), mask)
end
end

Expand Down
2 changes: 1 addition & 1 deletion base/sparse/sparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ end
# convert'ing from SparseMatrixCSC to other matrix types
function convert(::Type{Matrix}, S::SparseMatrixCSC{Tv}) where Tv
# Handle cases where zero(Tv) is not defined but the array is dense.
A = length(S) == nnz(S) ? Array{Tv}(S.m, S.n) : zeros(Tv, S.m, S.n)
A = length(S) == nnz(S) ? Matrix{Tv}(S.m, S.n) : zeros(Tv, S.m, S.n)
for Sj in 1:S.n
for Sk in nzrange(S, Sj)
Si = S.rowval[Sk]
Expand Down

0 comments on commit 46551cd

Please sign in to comment.