Browse Source

Replaced expensive modulus operation with bitwise-and.

QGC4.4
Bryant Mairs 11 years ago
parent
commit
8d3e1779dd
  1. 2
      src/comm/MAVLinkProtocol.cc

2
src/comm/MAVLinkProtocol.cc

@ -503,7 +503,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b) @@ -503,7 +503,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
lastIndex[message.sysid][message.compid] = expectedSeq;
// Update on every 32th packet
if (totalReceiveCounter[linkId] % 32 == 0)
if ((totalReceiveCounter[linkId] & 0x1F) == 0)
{
// Calculate new loss ratio
// Receive loss

Loading…
Cancel
Save