We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eadd83d commit ac83f4bCopy full SHA for ac83f4b
src/libstd/vec.rs
@@ -155,8 +155,10 @@ pub fn from_fn<T>(n_elts: uint, op: old_iter::InitOp<T>) -> ~[T] {
155
* to the value `t`.
156
*/
157
pub fn from_elem<T:Copy>(n_elts: uint, t: T) -> ~[T] {
158
- // hack: manually inline from_fn for 2x plus speedup (sadly very important, from_elem is a
159
- // 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
160
+ // still is substantially slower than using the unsafe
161
+ // vec::with_capacity/ptr::set_memory for primitive types.
162
unsafe {
163
let mut v = with_capacity(n_elts);
164
do as_mut_buf(v) |p, _len| {
0 commit comments