Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there a typo in the code block for the `Process` function near the end of the post? Lines 13-15 have the following loop:

        while (remapVec[remapStartIndex] >= index) { // Follow the 'cycle'
            index = remapVec[remapStartIndex];
        }
I'm not sure what that loop is supposed to be doing, but as its written it looks like it would either be skipped entirely or never terminate; after single iteration, the the two values would be equal and never change again.


The authors probably intended to write:

                index = remapVec[index];
which would do a better job at following a cycle.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: