diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2022-04-22 01:01:56 +0200 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2022-04-25 19:13:22 +0200 |
commit | 997e2e374a77cc4b02777efdc02d8338da11fb30 (patch) | |
tree | 6444c1aa9dc5ee730c0886ff45f44a9de2b3ccca | |
parent | 0d86d8c8d5c7154fd68871d63c49253db3da44ed (diff) | |
download | libnotify-997e2e374a77cc4b02777efdc02d8338da11fb30.tar.gz |
notification: Do not duplicate calls on parse functions
-rw-r--r-- | libnotify/notification.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libnotify/notification.c b/libnotify/notification.c index d3e3b6f..54d8169 100644 --- a/libnotify/notification.c +++ b/libnotify/notification.c @@ -1033,24 +1033,24 @@ maybe_parse_snap_hint_value (NotifyNotification *notification, const gchar *key, GVariant *value) { + StringParserFunc parse_func = NULL; + if (!notification->priv->snap_path) return value; if (g_strcmp0 (key, "desktop-entry") == 0) { - value = get_parsed_variant (notification, - key, - value, - try_prepend_snap_desktop); + parse_func = try_prepend_snap_desktop; } else if (g_strcmp0 (key, "image-path") == 0 || g_strcmp0 (key, "image_path") == 0 || g_strcmp0 (key, "sound-file") == 0) { - value = get_parsed_variant (notification, - key, - value, - try_prepend_snap); + parse_func = try_prepend_snap; + } + + if (parse_func == NULL) { + return value; } - return value; + return get_parsed_variant (notification, key, value, parse_func); } /** |