mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 09:10:17 +01:00
keyfile: use nm_g_error_matches() in g_error_matches()
nm_g_error_matches() can be inlined and first checks whether the error argument is not NULL. At least from the keyfile accessor functions, use this macro, as they are called many times.
This commit is contained in:
parent
e08bb66b34
commit
5cdb636301
1 changed files with 4 additions and 4 deletions
|
|
@ -117,7 +117,7 @@ nm_keyfile_plugin_kf_get_string_list (GKeyFile *kf,
|
|||
gsize l;
|
||||
|
||||
list = g_key_file_get_string_list (kf, group, key, &l, &local);
|
||||
if (g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) {
|
||||
if (nm_g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) {
|
||||
alias = nm_keyfile_plugin_get_alias_for_setting_name (group);
|
||||
if (alias) {
|
||||
g_clear_error (&local);
|
||||
|
|
@ -246,7 +246,7 @@ fcn_name (GKeyFile *kf, \
|
|||
GError *local = NULL; \
|
||||
\
|
||||
val = key_file_get_fcn (kf, group, key, &local); \
|
||||
if (g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) { \
|
||||
if (nm_g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) { \
|
||||
alias = nm_keyfile_plugin_get_alias_for_setting_name (group); \
|
||||
if (alias) { \
|
||||
g_clear_error (&local); \
|
||||
|
|
@ -323,7 +323,7 @@ nm_keyfile_plugin_kf_get_keys (GKeyFile *kf,
|
|||
gsize l;
|
||||
|
||||
keys = g_key_file_get_keys (kf, group, &l, &local);
|
||||
if (g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) {
|
||||
if (nm_g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) {
|
||||
alias = nm_keyfile_plugin_get_alias_for_setting_name (group);
|
||||
if (alias) {
|
||||
g_clear_error (&local);
|
||||
|
|
@ -351,7 +351,7 @@ nm_keyfile_plugin_kf_has_key (GKeyFile *kf,
|
|||
GError *local = NULL;
|
||||
|
||||
has = g_key_file_has_key (kf, group, key, &local);
|
||||
if (g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) {
|
||||
if (nm_g_error_matches (local, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_GROUP_NOT_FOUND)) {
|
||||
alias = nm_keyfile_plugin_get_alias_for_setting_name (group);
|
||||
if (alias) {
|
||||
g_clear_error (&local);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue