Skip to content

Commit

Permalink
initialize array set types with default size instead of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Aug 8, 2018
1 parent 06c38e6 commit 300f004
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/CartesianProduct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ end

# constructor for an empty product with optional size hint and numeric type
function CartesianProductArray(n::Int=0, N::Type=Float64)::CartesianProductArray
arr = Vector{LazySet{N}}(0)
arr = Vector{LazySet{N}}()
sizehint!(arr, n)
return CartesianProductArray(arr)
end
Expand Down
2 changes: 1 addition & 1 deletion src/ConvexHull.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ end

# constructor for an empty hull with optional size hint and numeric type
function ConvexHullArray(n::Int=0, N::Type=Float64)::ConvexHullArray
a = Vector{LazySet{N}}(0)
a = Vector{LazySet{N}}()
sizehint!(a, n)
return ConvexHullArray(a)
end
Expand Down
2 changes: 1 addition & 1 deletion src/Intersection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ end

# constructor for an empty sum with optional size hint and numeric type
function IntersectionArray(n::Int=0, N::Type=Float64)::IntersectionArray
arr = Vector{LazySet{N}}(0)
arr = Vector{LazySet{N}}()
sizehint!(arr, n)
return IntersectionArray(arr)
end
Expand Down
4 changes: 2 additions & 2 deletions src/MinkowskiSum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ end

# constructor for an empty sum with optional size hint and numeric type
function MinkowskiSumArray(n::Int=0, N::Type=Float64)::MinkowskiSumArray
arr = Vector{LazySet{N}}(0)
arr = Vector{LazySet{N}}()
sizehint!(arr, n)
return MinkowskiSumArray(arr)
end
Expand Down Expand Up @@ -286,7 +286,7 @@ CacheMinkowskiSum(arr::Vector{S}) where {N<:Real, S<:LazySet{N}} =

# constructor for an empty sum with optional size hint and numeric type
function CacheMinkowskiSum(n::Int=0, N::Type=Float64)::CacheMinkowskiSum
arr = Vector{LazySet{N}}(0)
arr = Vector{LazySet{N}}()
sizehint!(arr, n)
return CacheMinkowskiSum(arr)
end
Expand Down

0 comments on commit 300f004

Please sign in to comment.