From: Ben Pfaff Date: Mon, 4 Jul 2011 21:49:22 +0000 (-0700) Subject: variable: Simplify var_set_display_width(). X-Git-Tag: v0.7.9~212 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e98c317cda4361ba7e3e7de0f064be7d8100bcdb;p=pspp-builds.git variable: Simplify var_set_display_width(). I don't see a reason to keep old_width or to call dict_var_changed() if nothing changed. --- diff --git a/src/data/variable.c b/src/data/variable.c index 41f9221d..1f9b62e1 100644 --- a/src/data/variable.c +++ b/src/data/variable.c @@ -693,14 +693,12 @@ var_get_display_width (const struct variable *v) void var_set_display_width (struct variable *v, int new_width) { - int old_width = v->display_width; - - v->display_width = new_width; - - if ( old_width != new_width) - dict_var_display_width_changed (v); - - dict_var_changed (v); + if (v->display_width != new_width) + { + v->display_width = new_width; + dict_var_display_width_changed (v); + dict_var_changed (v); + } } /* Returns the default display width for a variable of the given