mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 13:05:22 +02:00
[cleanup] System.arraycopy() instead of plain loop
This commit is contained in:
parent
3eae75442c
commit
ae30da557a
1 changed files with 3 additions and 6 deletions
|
@ -126,7 +126,7 @@ public class XMLparser
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set whether to enable keepalive
|
* Set whether to enable keepalive
|
||||||
* @param enable
|
* @param enable <code>true</code> to enable keepalive
|
||||||
*/
|
*/
|
||||||
public void setEnableKeepalive(boolean enable){
|
public void setEnableKeepalive(boolean enable){
|
||||||
// if false, we ignore the keepalive stuff
|
// if false, we ignore the keepalive stuff
|
||||||
|
@ -136,7 +136,7 @@ public class XMLparser
|
||||||
/**
|
/**
|
||||||
* Set the keepalive response timeout
|
* Set the keepalive response timeout
|
||||||
* @param timeout the time to wait for a response after
|
* @param timeout the time to wait for a response after
|
||||||
* initiating a keepalivfe request
|
* initiating a keepalive request
|
||||||
*/
|
*/
|
||||||
public void setKeepaliveResponseTimeout(int timeout){
|
public void setKeepaliveResponseTimeout(int timeout){
|
||||||
// the new value will be picked up on the next readLine() call
|
// the new value will be picked up on the next readLine() call
|
||||||
|
@ -401,10 +401,7 @@ public class XMLparser
|
||||||
{
|
{
|
||||||
int newMaxBuffer = 2 * _maxBuffer;
|
int newMaxBuffer = 2 * _maxBuffer;
|
||||||
byte[] newBuffer = new byte[newMaxBuffer];
|
byte[] newBuffer = new byte[newMaxBuffer];
|
||||||
for (int i = 0; i < _maxBuffer; i++){
|
System.arraycopy(_byteBuffer, 0, newBuffer, 0, _maxBuffer);
|
||||||
newBuffer[i] = _byteBuffer[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
_maxBuffer = newMaxBuffer;
|
_maxBuffer = newMaxBuffer;
|
||||||
_byteBuffer = newBuffer;
|
_byteBuffer = newBuffer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue