diff options
author | Thomas Haller <thaller@redhat.com> | 2019-12-12 11:52:11 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-12-24 07:47:50 +0100 |
commit | 1cab6367b2c4a509689bf2009719b2fcdb836c04 (patch) | |
tree | 69562bdb3228ce588cd09f01edee98864a556a89 /libnm-core/nm-setting-cdma.c | |
parent | 0de6cd2d68a8351d7fc1ee3b90f719407fd06b3d (diff) | |
download | NetworkManager-1cab6367b2c4a509689bf2009719b2fcdb836c04.tar.gz |
libnm: don't have G_PARAM_CONSTRUCT properties in NMSetting instances
G_PARAM_CONSTRUCT cause to explicitly initialize the property during
object construction. This is an unnecessary overhead that we can easily
avoid.
The overhead is because G_PARAM_CONSTRUCT parameters are always set with
g_object_set() before calling constructed(). Even if they are not specified
during g_object_new(), in which case it calls set with the property's default
value. This also requires g_object_new() to iterate all properties to
find and sort the construct properties.
NMSetting are supposed to be simple classes. They don't need to have
their properties initialized before object construction completes.
Especially if the default values are NULL or zero, in which case there
is nothing to do. If the default value is not NULL or zero, we need
to initialize the field instead in the nm_setting*_init() function.
Diffstat (limited to 'libnm-core/nm-setting-cdma.c')
-rw-r--r-- | libnm-core/nm-setting-cdma.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/libnm-core/nm-setting-cdma.c b/libnm-core/nm-setting-cdma.c index 23ca04b968..e303ab8abd 100644 --- a/libnm-core/nm-setting-cdma.c +++ b/libnm-core/nm-setting-cdma.c @@ -350,7 +350,6 @@ nm_setting_cdma_class_init (NMSettingCdmaClass *klass) g_param_spec_uint (NM_SETTING_CDMA_MTU, "", "", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | - G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE | G_PARAM_STATIC_STRINGS); |