refactor: remove redundant null checks

viewer-2-initial-appearance
Justin Clark-Casey (justincc) 2011-01-17 23:57:50 +00:00
parent 81552099d6
commit 6e58996b4d
1 changed files with 15 additions and 30 deletions

View File

@ -141,27 +141,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void ProcessQueues() private void ProcessQueues()
{ {
// Process all the pending adds // Process all the pending adds
OutgoingPacket pendingAdd; OutgoingPacket pendingAdd;
if (m_pendingAdds != null)
{
while (m_pendingAdds.TryDequeue(out pendingAdd)) while (m_pendingAdds.TryDequeue(out pendingAdd))
{
if (pendingAdd != null && m_packets != null)
{
m_packets[pendingAdd.SequenceNumber] = pendingAdd; m_packets[pendingAdd.SequenceNumber] = pendingAdd;
}
}
}
// Process all the pending removes, including updating statistics and round-trip times // Process all the pending removes, including updating statistics and round-trip times
PendingAck pendingRemove; PendingAck pendingRemove;
OutgoingPacket ackedPacket; OutgoingPacket ackedPacket;
if (m_pendingRemoves != null)
{
while (m_pendingRemoves.TryDequeue(out pendingRemove)) while (m_pendingRemoves.TryDequeue(out pendingRemove))
{
if (m_pendingRemoves != null && m_packets != null)
{ {
if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
{ {
@ -181,6 +168,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
} }
} }
}
}
} }