We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f74e193 + ac83f4b commit d1927d2Copy full SHA for d1927d2
src/libstd/vec.rs
@@ -146,8 +146,10 @@ pub fn from_fn<T>(n_elts: uint, op: old_iter::InitOp<T>) -> ~[T] {
146
* to the value `t`.
147
*/
148
pub fn from_elem<T:Copy>(n_elts: uint, t: T) -> ~[T] {
149
- // hack: manually inline from_fn for 2x plus speedup (sadly very important, from_elem is a
150
- // bottleneck in borrowck!)
+ // FIXME (#7136): manually inline from_fn for 2x plus speedup (sadly very
+ // important, from_elem is a bottleneck in borrowck!). Unfortunately it
151
+ // still is substantially slower than using the unsafe
152
+ // vec::with_capacity/ptr::set_memory for primitive types.
153
unsafe {
154
let mut v = with_capacity(n_elts);
155
do as_mut_buf(v) |p, _len| {
0 commit comments