3 ms·
Looking at the Rust source [1] it seems there the `next()` call has some overhead, so it's probably not the compiler. I remember this was simple to implement i
by stabbles 8y ago
Looking at the Rust source [1] it seems there the `next()` call has some overhead, so it's probably not the compiler.
I remember this was simple to implement in Julia [2] where you can iterate over the full range `for i = typemin(Int):typemax(Int) ... end` without overflow and without overhead. Same should be possible in Rust I think.
[1] https://doc.rust-lang.org/src/core/iter/range.rs.html#340-353 https://doc.rust-lang.org/src/core/iter/range.rs.html#340-35...
[2] https://github.com/JuliaLang/julia/blob/master/base/range.jl#L591-L598 https://github.com/JuliaLang/julia/blob/master/base/range.jl...