Using the XOR operator to calculate a checksum
There are situations where an infinite loop while (true) is warranted, this is not one of them. The code implies that the loop shall be broken when dividerPost reaches zero. Say it explicitly:

        while (dividerPos &gt; 0) {
            if (idx == dividerPos) {
                count += (length - dividerPos);
                --dividerPos;
                idx = 0;
                continue;
            }

            checksum ^= count;

            ++idx;
            ++count;
        }
        return checksum;

Now it is easy to see that the body of the loop is another loop in disguise. Again, be explicit:

        while (dividerPos &gt; 0) {
            for (idx = 0; idx &lt; dividerPos; idx++, count++) {
                checksum ^= count;
            }   
            count += (length - dividerPos);
            --dividerPos;
        }   

Now it is clear what the code is doing, and what it is doing inefficiently. An immediately identified bottleneck is an inner loop. What it does, it compute an xor of a range of numbers The first hit for a xor of a range query is this discussion. Study it, and see how it is applicable here. That itself will give your code a boost. Then try to optimize the outer loop.


PS: It is crucial to understand that the language doesn't matter. 

PPS: Sorry if I sound harsh, but when I say study, I mean study. Don't skim. Understand how it works. Prove that it works correctly.

PPPS: Both answers in the page you've linked miss the point.