From 5d986fd42ad299580debf38028513a7bc419525c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 6 Sep 2024 10:47:12 -0400 Subject: [PATCH] dir: Avoid some allocations If no error is passed, we don't need to do charset conversions. --- glib/gdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/gdir.c b/glib/gdir.c index 073be6ad1..7531bc78a 100644 --- a/glib/gdir.c +++ b/glib/gdir.c @@ -156,7 +156,7 @@ g_dir_open (const gchar *path, dir = g_dir_open_with_errno (path, flags); - if (dir == NULL) + if (dir == NULL && error != NULL) { gchar *utf8_path;