mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 13:06:28 +03:00
Allocate less on empty reads in procsrv
This commit is contained in:
@@ -106,7 +106,7 @@ fn readclose(fd: c_int) -> ~str {
|
||||
let mut buf = ~"";
|
||||
while !reader.eof() {
|
||||
let bytes = reader.read_bytes(4096u);
|
||||
buf += str::from_bytes(bytes);
|
||||
str::push_str(buf, str::from_bytes(bytes));
|
||||
}
|
||||
os::fclose(file);
|
||||
return buf;
|
||||
|
||||
Reference in New Issue
Block a user