This code was notifying a width change every time, even if the width did
not really change, which is wasteful. This had a side effect of revealing
a bug in the GUI code which caused an assertion failure. The bug still
remains in the GUI code, though it is now slightly harder to trigger, and
will be fixed separately in an upcoming commit.
if (fmt_resize (&v->write, new_width))
traits |= VAR_TRAIT_WRITE_FORMAT;
- v->width = new_width;
- traits |= VAR_TRAIT_WIDTH;
+ if (v->width != new_width)
+ {
+ v->width = new_width;
+ traits |= VAR_TRAIT_WIDTH;
+ }
if (print)
{
traits |= VAR_TRAIT_WRITE_FORMAT;
}
- dict_var_changed (v, traits, ov);
+ if (traits != 0)
+ dict_var_changed (v, traits, ov);
}
/* Changes the width of V to NEW_WIDTH.