On Fri, 12 May 2023 18:32:35 GMT, Kevin Walls <kev...@openjdk.org> wrote:
> Problem call to skipWhitespace in dbgsysExec > src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c:91 > > We call skipWhitespace even when the loop will terminate, should guard > against the last skipWhitespace call on the last iteration. > > Could be done differently with the skipWhitespace call at the start of the > loop, but skipped on the first iteration, but leaving the statements in the > loop in the same order seems more readable. src/jdk.jdwp.agent/unix/native/libjdwp/exec_md.c line 93: > 91: if ((i + 1) == argc) { > 92: break; // finished: do not call skipWhitespace again > 93: } It seems a bit odd, because you are breaking out of the middle of the loop by using a breakout condition that is already in the `for` statement, and now serves no purpose. I think I like the idea of moving `skipWhitespace(p)` to the start of the loop. No need to skip in on the first iteration. It will just return p. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13964#discussion_r1192736974