提交 858e1661 编写于 作者: S Steven Fackler

Removing space for NULL terminator

String NULL terminators are going away soon, so we may as well get rid
of this now so it doesn't rot.
上级 ff5fdffc
......@@ -38,8 +38,7 @@ impl<'self> ToHex for &'self [u8] {
* ~~~
*/
fn to_hex(&self) -> ~str {
// +1 for NULL terminator
let mut v = vec::with_capacity(self.len() * 2 + 1);
let mut v = vec::with_capacity(self.len() * 2);
for &byte in self.iter() {
v.push(CHARS[byte >> 4]);
v.push(CHARS[byte & 0xf]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册