[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sheet-prep-2 3/3] variable: Simplify var_set_display_width().
From: |
Ben Pfaff |
Subject: |
[sheet-prep-2 3/3] variable: Simplify var_set_display_width(). |
Date: |
Tue, 12 Jul 2011 22:21:49 -0700 |
I don't see a reason to keep old_width or to call
dict_var_changed() if nothing changed.
---
src/data/variable.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/data/variable.c b/src/data/variable.c
index 41f9221..1f9b62e 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
--
1.7.2.5