Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7e10f1a authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by android-build-merger
Browse files

Merge "Simplify and fix checksumAdjust."

am: c4f88900

Change-Id: Ida4d79de0f41229d6e21930529e7dc73a1265ee0
parents b661df77 c4f88900
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -779,12 +779,7 @@ public class IpClientIntegrationTest {

    private static short checksumAdjust(short checksum, short oldWord, short newWord) {
        checksum = (short) ~checksum;
        int tempSum = checksumFold(uint16(checksum) + newWord);
        if (tempSum > oldWord) {
            tempSum -= oldWord;
        } else {
            tempSum += 0xffff - oldWord;
        }
        int tempSum = checksumFold(uint16(checksum) + uint16(newWord) + 0xffff - uint16(oldWord));
        return (short) ~tempSum;
    }