summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-03-16 15:43:12 +0100
committerLubomir Rintel <lkundrak@v3.sk>2015-03-16 15:44:14 +0100
commit2e86c37dd3c996e85f0ab71c12bec0ae2e097a87 (patch)
tree2bc9b08cbc96b83f341a2dccc6f84ddb615401cb
parent641a57994c83ed3622002b2d40fc1f9b030057bf (diff)
downloadNetworkManager-2e86c37dd3c996e85f0ab71c12bec0ae2e097a87.tar.gz
trivial: do an assignment before the conditional instead of in both branches
[lkundrak@v3.sk: An improvement suggested in bugzilla, but I failed to apply it to the commit.] https://bugzilla.redhat.com/show_bug.cgi?id=1079353
-rw-r--r--libnm/nm-object.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libnm/nm-object.c b/libnm/nm-object.c
index fbdbc1f625..5504efbe53 100644
--- a/libnm/nm-object.c
+++ b/libnm/nm-object.c
@@ -681,6 +681,8 @@ object_property_complete (ObjectCreatedData *odata)
for (i = 0; i < odata->length; i++)
add_to_object_array_unique (new, odata->objects[i]);
+ *((GPtrArray **) pi->field) = new;
+
if (pi->signal_prefix) {
GPtrArray *added = g_ptr_array_sized_new (3);
GPtrArray *removed = g_ptr_array_sized_new (3);
@@ -691,8 +693,6 @@ object_property_complete (ObjectCreatedData *odata)
/* Find objects in 'new' that do not exist in old */
array_diff (new, old, added);
- *((GPtrArray **) pi->field) = new;
-
/* Emit added & removed */
for (i = 0; i < removed->len; i++) {
queue_added_removed_signal (self,
@@ -715,7 +715,6 @@ object_property_complete (ObjectCreatedData *odata)
/* No added/removed signals to send, just replace the property with
* the new values.
*/
- *((GPtrArray **) pi->field) = new;
different = TRUE;
}