gdbusconnection: Combine two identical variables

`object_path` and `path` were doing exactly the same thing here.

This introduces no functional changes.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
This commit is contained in:
Philip Withnall 2023-08-16 16:24:02 +01:00
parent 7cca4b1590
commit eae5c49085

View File

@ -7186,10 +7186,9 @@ distribute_method_call (GDBusConnection *connection,
GDBusMessage *reply; GDBusMessage *reply;
ExportedObject *eo; ExportedObject *eo;
ExportedSubtree *es; ExportedSubtree *es;
const gchar *object_path; const gchar *path;
const gchar *interface_name; const gchar *interface_name;
const gchar *member; const gchar *member;
const gchar *path;
gchar *subtree_path; gchar *subtree_path;
gchar *needle; gchar *needle;
gboolean object_found = FALSE; gboolean object_found = FALSE;
@ -7228,17 +7227,14 @@ distribute_method_call (GDBusConnection *connection,
_g_dbus_debug_print_unlock (); _g_dbus_debug_print_unlock ();
} }
object_path = g_dbus_message_get_path (message); eo = g_hash_table_lookup (connection->map_object_path_to_eo, path);
g_assert (object_path != NULL);
eo = g_hash_table_lookup (connection->map_object_path_to_eo, object_path);
if (eo != NULL) if (eo != NULL)
{ {
if (obj_message_func (connection, eo, message, &object_found)) if (obj_message_func (connection, eo, message, &object_found))
goto out; goto out;
} }
es = g_hash_table_lookup (connection->map_object_path_to_es, object_path); es = g_hash_table_lookup (connection->map_object_path_to_es, path);
if (es != NULL) if (es != NULL)
{ {
if (subtree_message_func (connection, es, message)) if (subtree_message_func (connection, es, message))
@ -7265,14 +7261,14 @@ distribute_method_call (GDBusConnection *connection,
"org.freedesktop.DBus.Error.UnknownMethod", "org.freedesktop.DBus.Error.UnknownMethod",
_("No such interface “%s” on object at path %s"), _("No such interface “%s” on object at path %s"),
interface_name, interface_name,
object_path); path);
} }
else else
{ {
reply = g_dbus_message_new_method_error (message, reply = g_dbus_message_new_method_error (message,
"org.freedesktop.DBus.Error.UnknownMethod", "org.freedesktop.DBus.Error.UnknownMethod",
_("Object does not exist at path “%s”"), _("Object does not exist at path “%s”"),
object_path); path);
} }
g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL); g_dbus_connection_send_message_unlocked (connection, reply, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);