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

Commit c4f88900 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Simplify and fix checksumAdjust."

parents 71ff8401 f040a471
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;
    }