mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +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,6 +929,7 @@ g_resource_enumerate_children (GResource *resource,
|
|||||||
|
|
||||||
if (*path == 0)
|
if (*path == 0)
|
||||||
{
|
{
|
||||||
|
if (error)
|
||||||
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
|
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
|
||||||
_("The resource at “%s” does not exist"),
|
_("The resource at “%s” does not exist"),
|
||||||
path);
|
path);
|
||||||
@ -968,6 +969,7 @@ g_resource_enumerate_children (GResource *resource,
|
|||||||
|
|
||||||
if (children == NULL)
|
if (children == NULL)
|
||||||
{
|
{
|
||||||
|
if (error)
|
||||||
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
|
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
|
||||||
_("The resource at “%s” does not exist"),
|
_("The resource at “%s” does not exist"),
|
||||||
path);
|
path);
|
||||||
@ -1237,6 +1239,7 @@ g_resources_enumerate_children (const gchar *path,
|
|||||||
|
|
||||||
if (hash == NULL)
|
if (hash == NULL)
|
||||||
{
|
{
|
||||||
|
if (error)
|
||||||
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
|
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
|
||||||
_("The resource at “%s” does not exist"),
|
_("The resource at “%s” does not exist"),
|
||||||
path);
|
path);
|
||||||
|
Loading…
Reference in New Issue
Block a user