mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
resourcefile: Avoid an allocation
Instead of enumerating the children only to throw them away, use the new g_resources_has_children() api.
This commit is contained in:
parent
a14241c895
commit
46fdbb43fa
@ -455,21 +455,14 @@ g_resource_file_query_info (GFile *file,
|
||||
gboolean res;
|
||||
gsize size = 0;
|
||||
guint32 resource_flags = 0;
|
||||
char **children;
|
||||
gboolean is_dir;
|
||||
char *base;
|
||||
|
||||
is_dir = FALSE;
|
||||
children = g_resources_enumerate_children (resource->path, 0, NULL);
|
||||
if (children != NULL)
|
||||
{
|
||||
g_strfreev (children);
|
||||
is_dir = TRUE;
|
||||
}
|
||||
|
||||
/* root is always there */
|
||||
if (strcmp ("/", resource->path) == 0)
|
||||
is_dir = TRUE;
|
||||
else
|
||||
is_dir = g_resources_has_children (resource->path);
|
||||
|
||||
if (!is_dir)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user