Specify data type on list creation for performance
This commit is contained in:
parent
45338f7fdd
commit
7e6e92b13e
@ -37,7 +37,7 @@ function Problem12()
|
||||
|
||||
function num_divisors(n)
|
||||
res = floor(Int, sqrt(n))
|
||||
divs = []
|
||||
divs = Int[]
|
||||
for i = 1:res
|
||||
if n % i == 0
|
||||
append!(divs, i)
|
||||
|
Loading…
x
Reference in New Issue
Block a user