The unusual structure of the loop in this function made it appear as if it was
intending to cope with e.g. an `n` of 0 but still print the first element of
`p`. Surveying the callers of `gvprintpointflist`, we can see it is never used
this way. So we can write it simpler and more readably.
void gvprintpointflist(GVJ_t * job, pointf *p, int n)
{
- int i = 0;
-
- while (true) {
- gvprintpointf(job, p[i]);
- if (++i >= n) break;
- gvwrite(job, " ", 1);
- }
+ const char *separator = "";
+ for (int i = 0; i < n; ++i) {
+ gvputs(job, separator);
+ gvprintpointf(job, p[i]);
+ separator = " ";
+ }
}
-