No effective change - code cleanup - remove unnecessary boxing

This commit is contained in:
Robin Bygrave committed 2015-07-31 20:08:30 +12:00
1 parent ba3b1fea6f
commit 9fe47194ff
34 files changed
+55 -78

No files matched your search

@@ -170,7 +170,7 @@ public class IncomingPacketsProcessed {
boolean lostPacket = false;
for (long i = gotAllPoint + 1; i < gotMaxPoint; i++) {
Long packetId = Long.valueOf(i);
Long packetId = i;
if (!outOfOrderList.contains(packetId)) {
if (incrementResendCount(packetId)) {
// request this packet be resent
@@ -195,7 +195,7 @@ public class IncomingPacketsProcessed {
private boolean incrementResendCount(Long packetId){
Integer resendCount = resendCountMap.get(packetId);
if (resendCount != null){
int i = resendCount.intValue() + 1;
int i = resendCount + 1;
if (i > maxResendIncoming){
// we are going to give up trying to get this packet now
logger.warn("Exceeded maxResendIncoming["+maxResendIncoming+"] for packet["+packetId+"]. Giving up on requesting it.");
@@ -203,7 +203,7 @@ public class IncomingPacketsProcessed {
outOfOrderList.add(packetId);
return false;
}
resendCount = Integer.valueOf(i);
resendCount = i;
resendCountMap.put(packetId, resendCount);
} else {
resendCountMap.put(packetId, ONE);
@@ -211,7 +211,7 @@ public class IncomingPacketsProcessed {
return true;
}
private static final Integer ONE = Integer.valueOf(1);
private static final Integer ONE = 1;
public boolean processPacket(long packetId) {
synchronized (this) {
@@ -235,7 +235,7 @@ public class IncomingPacketsProcessed {
if (packetId > gotMaxPoint) {
gotMaxPoint = packetId;
}
outOfOrderList.add(Long.valueOf(packetId));
outOfOrderList.add(packetId);
}
checkOutOfOrderList();
return true;
@@ -256,7 +256,7 @@ public class IncomingPacketsProcessed {
Iterator<Long> it = outOfOrderList.iterator();
while (it.hasNext()) {
Long id = it.next();
if (id.longValue() == nextPoint) {
if (id == nextPoint) {
// we found the next one in the outOfOrderList
it.remove();
gotAllPoint = nextPoint;
@@ -14,7 +14,6 @@ import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
@@ -37,7 +37,7 @@ public class MessageResend implements Message {
}
public void add(long packetId){
resendPacketIds.add(Long.valueOf(packetId));
resendPacketIds.add(packetId);
}
public List<Long> getResendPacketIds() {
@@ -57,7 +57,7 @@ public class OutgoingPacketsCache {
Iterator<Long> it = packetMap.keySet().iterator();
while (it.hasNext()) {
Long pktId = it.next();
if (minAcked >= pktId.longValue()) {
if (minAcked >= pktId) {
it.remove();
}
}