File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ This also provides a few functions unconnected to `PrimeSet`, which will be fast
60
60
case, but slower in the long term as they do not use any caching of primes.
61
61
62
62
*/
63
- #![ feature( step_by) ]
64
63
#![ doc( html_root_url = "https://wackywendell.github.io/primes/" ) ]
65
64
66
65
#[ warn( non_camel_case_types) ]
@@ -253,7 +252,9 @@ impl<'a> Iterator for PrimeSetIter<'a> {
253
252
/// Find the first factor (other than 1) of a number
254
253
fn firstfac ( x : u64 ) -> u64 {
255
254
if x % 2 == 0 { return 2 ; } ;
256
- for n in ( 3 ..) . step_by ( 2 ) . take_while ( |m| m* m <= x) {
255
+ // TODO: return to step_by
256
+ // for n in (3..).step_by(2).take_while(|m| m*m <= x) {
257
+ for n in ( 1 ..) . map ( |m| 2 * m+1 ) . take_while ( |m| m* m <= x) {
257
258
if x % n == 0 { return n; } ;
258
259
}
259
260
return x;
You can’t perform that action at this time.
0 commit comments