By out of bounds checking I mean :-
P[j] frequently becomes undefined as the code runs off the end of the P array and the if statement functions in ways which are not obvious.
I just think anyone in future modifying this code would want this part of the design highlighted.
I appreciate the sparse documentation in this code. The coding style is good enough that the code mostly speaks for itself.
I want to talk about the implicit out of bounds checking which I think needs documenting as it will go unnoticed by the casual reader.
This can be seen by running the second half of ""zero-length edges are removed" in a debugger.
By out of bounds checking I mean :- P[j] frequently becomes undefined as the code runs off the end of the P array and the if statement functions in ways which are not obvious.
I just think anyone in future modifying this code would want this part of the design highlighted.