We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25371c5 commit 1479dbcCopy full SHA for 1479dbc
src/factorization.jl
@@ -4,7 +4,12 @@
4
struct Factorization{T<:Integer} <: AbstractDict{T, Int}
5
pe::Vector{Pair{T, Int}} # Prime-Exponent
6
7
- Factorization{T}() where {T<:Integer} = new{T}(Vector{Pair{T, Int}}())
+ function Factorization{T}() where {T<:Integer}
8
+ # preallocates enough space that numbers smaller than 2310 won't need to resize
9
+ v = Vector{Pair{T, Int}}(undef, 4)
10
+ empty!(v)
11
+ new{T}(v)
12
+ end
13
end
14
15
function Factorization{T}(d::AbstractDict) where T<:Integer
0 commit comments