Allocate less on empty reads in procsrv
This commit is contained in:
parent
b2452896d1
commit
8bbe70c207
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user