mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 14:15:23 +02:00
[208166] Avoid unnecessary arraycopy in BoundedByteBuffer
This commit is contained in:
parent
0e1dd48e01
commit
bfc803fd98
1 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
* Douglas Lea (Addison Wesley) - [cq:1552] BoundedBufferWithStateTracking adapted to BoundedByteBuffer
|
||||
* Martin Oberhuber (Wind River) - the waitForAvailable method
|
||||
* Martin Oberhuber (Wind River) - [208166] Avoid unnecessary arraycopy in BoundedByteBuffer
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.tm.internal.terminal.textcanvas;
|
||||
|
@ -100,7 +101,7 @@ public class PipedInputStream extends InputStream {
|
|||
wait();
|
||||
int n = Math.min(len, fBuffer.length - fPutPos);
|
||||
System.arraycopy(b, off, fBuffer, fPutPos, n);
|
||||
if (fPutPos + len > n)
|
||||
if (fPutPos + len > fBuffer.length)
|
||||
System.arraycopy(b, off + n, fBuffer, 0, len - n);
|
||||
fPutPos = (fPutPos + len) % fBuffer.length; // cyclically increment
|
||||
boolean wasEmpty = fUsedSlots == 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue