about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-06-16 00:58:09 -0700
committerbors <bors@rust-lang.org>2013-06-16 00:58:09 -0700
commitd1927d295013e19e57a9773c37ded698e89392eb (patch)
treebfb6e89eb9b408ca5069f8b14b56551971f9d9a8 /src/libstd
parentf74e1935aa55aff7ecf9ac75a5114a7b41d4e56f (diff)
parentac83f4b7325eea6ec82db73fb5c1ece7d8320908 (diff)
downloadrust-d1927d295013e19e57a9773c37ded698e89392eb.tar.gz
rust-d1927d295013e19e57a9773c37ded698e89392eb.zip
auto merge of #7137 : erickt/rust/from-elem-fixme, r=thestinger
This is to make sure we track optimizing `vec::from_elem`.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/vec.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index 7b4764164b5..f330e13c5bd 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -146,8 +146,10 @@ pub fn from_fn<T>(n_elts: uint, op: old_iter::InitOp<T>) -> ~[T] {
  * to the value `t`.
  */
 pub fn from_elem<T:Copy>(n_elts: uint, t: T) -> ~[T] {
-    // hack: manually inline from_fn for 2x plus speedup (sadly very important, from_elem is a
-    // 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
+    // still is substantially slower than using the unsafe
+    // vec::with_capacity/ptr::set_memory for primitive types.
     unsafe {
         let mut v = with_capacity(n_elts);
         do as_mut_buf(v) |p, _len| {