Some perf fixes, although vec::slice is still too slow (Issue #2719)

This commit is contained in:
Eric Holk
2012-06-25 16:22:22 -07:00
parent 7adad4c6cb
commit b19c98ea9a
8 changed files with 18 additions and 14 deletions

View File

@@ -1727,7 +1727,7 @@ mod unsafe {
vec::reserve(v, len + 1u);
vec::as_buf(v) {|b| ptr::memcpy(b, buf, len); }
vec::unsafe::set_len(v, len);
v += [0u8];
vec::push(v, 0u8);
assert is_utf8(v);
ret ::unsafe::transmute(v);