stepcompress: don't increase max error

On every cycle last step happens at the time or before.
New max_error is equal to or larger than before.
Simplify logic by avoiding re-computing it.
It have insegnificant impact on the compressed output.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
Timofey Titovets 2026-02-07 16:29:11 +01:00
parent 86da9c846d
commit 3f728d5505

View file

@ -383,12 +383,6 @@ step_init_max_error(struct stepcompress *sc, struct qstep *pos)
pos->max_error = max_error;
}
static void
step_update_max_error(struct stepcompress *sc, struct qstep *pos)
{
step_init_max_error(sc, pos);
}
// Convert previously scheduled steps into commands for the mcu
static int
queue_flush(struct stepcompress *sc, uint64_t move_clock)
@ -396,7 +390,6 @@ queue_flush(struct stepcompress *sc, uint64_t move_clock)
if (sc->queue_pos >= sc->queue_next)
return 0;
while (sc->last_step_clock < move_clock) {
step_update_max_error(sc, sc->queue_pos);
struct step_move move = compress_bisect_add(sc);
int ret = check_line(sc, move);
if (ret)