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

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

Merge "Simplify and fix checksumAdjust." am: c4f88900

am: c7e10f1a

Change-Id: Ibbbff5bff073697a67bf1b4a6af0dc95c8940d65
parents 0ca651d9 c7e10f1a
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;
    }