Minor refactoring, so that the code workflow is the same as the other languages

master
Ivan Zahariev 2018-01-12 12:23:12 +02:00
parent 29cc736cd6
commit 612a67527b
1 changed files with 2 additions and 1 deletions

View File

@ -17,13 +17,14 @@ func get_primes7(_ n: Int) -> [Int] {
while m <= mroot {
if s[i] != 0 {
var j: Int = (m*m - 3) / 2
s[j] = 0
while j < half {
s[j] = 0
j += m
}
}
i += 1
m += 2
m = 2*i + 3
}
return [2] + s.filter { $0 != 0 }
}