mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
gresource: Avoid work for NULL errors
Don't go through gettext if the GError** passed is NULL anyway.
This commit is contained in:
parent
89f12e10b6
commit
105e44beb5
@ -929,9 +929,10 @@ g_resource_enumerate_children (GResource *resource,
|
||||
|
||||
if (*path == 0)
|
||||
{
|
||||
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
|
||||
_("The resource at “%s” does not exist"),
|
||||
path);
|
||||
if (error)
|
||||
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
|
||||
_("The resource at “%s” does not exist"),
|
||||
path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -968,9 +969,10 @@ g_resource_enumerate_children (GResource *resource,
|
||||
|
||||
if (children == NULL)
|
||||
{
|
||||
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
|
||||
_("The resource at “%s” does not exist"),
|
||||
path);
|
||||
if (error)
|
||||
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
|
||||
_("The resource at “%s” does not exist"),
|
||||
path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1237,9 +1239,10 @@ g_resources_enumerate_children (const gchar *path,
|
||||
|
||||
if (hash == NULL)
|
||||
{
|
||||
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
|
||||
_("The resource at “%s” does not exist"),
|
||||
path);
|
||||
if (error)
|
||||
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
|
||||
_("The resource at “%s” does not exist"),
|
||||
path);
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user