Commit 8d3e1779 authored by Bryant Mairs's avatar Bryant Mairs

Replaced expensive modulus operation with bitwise-and.

parent 7576bdd4
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment