1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Minor performance optimization in SpawnerInputStream

This commit is contained in:
Anton Leherbauer 2009-10-16 09:16:51 +00:00
parent 5e58b2deb1
commit 2b5ba96a39

View file

@ -61,13 +61,15 @@ class SpawnerInputStream extends InputStream {
} else if (len == 0) {
return 0;
}
byte[] tmpBuf = new byte[len];
byte[] tmpBuf = off > 0 ? new byte[len - off] : buf;
len = read0(fd, tmpBuf, len);
if (len <= 0)
return -1;
if (tmpBuf != buf) {
System.arraycopy(tmpBuf, 0, buf, off, len);
}
return len;
}