> > Lillian> - if (mark <= gapStart) > > Lillian> + if (mark <= gapStart || mark <= gapEnd) > > > > Isn't gapEnd >= gapStart? > > So the first test is redundant?
Sorry, I think the first version (mark <= gapStart) is correct as it was. The mark should always be 0<=mark<gapStart || gapEnd <= mark <= buffer.length. If it isn't then there is a problem at another place (very likely in shiftGap or shiftEnd, where the marks are updated). This is a typical case where I think an assert statement makes sense, that is to check the precondition. Also this is a case where we seriously need a Mauve test to check for regressions. > > Also, in passing, I wonder whether GapContent should use an ArrayList > > rather than a LinkedList to store the list of positions, for > > efficiency. Yeah, this is very well possible. I have not thought about this deep enough when writing this code. /Roman
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches