The following `for` loop can be found in `javafx.scence.chart.Axis`
{code:java}
int stop = 0;
for (; stop < tickMarks.size(); ++stop) {
TickMark<T> m = tickMarks.get(stop);
if (m.isTextVisible()) {
double tickHeight = measureTickMarkSize(m.getValue(), getRange()).getHeight();
lastStart = updateAndGetDisplayPosition(m) - tickHeight / 2;
}
break;
}
{code}
This always breaks after the first iteration and therefore the `for` statement could be removed. A simple if could check for `tickMarks.size()` being `> 0`.
{code:java}
int stop = 0;
for (; stop < tickMarks.size(); ++stop) {
TickMark<T> m = tickMarks.get(stop);
if (m.isTextVisible()) {
double tickHeight = measureTickMarkSize(m.getValue(), getRange()).getHeight();
lastStart = updateAndGetDisplayPosition(m) - tickHeight / 2;
}
break;
}
{code}
This always breaks after the first iteration and therefore the `for` statement could be removed. A simple if could check for `tickMarks.size()` being `> 0`.