mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-31 21:03:10 +02:00
gresource: Avoid a gettext lookup on a hot error path
See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4242#note_2215991 Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3465
This commit is contained in:
parent
b2d8394f17
commit
26f2d54840
@ -679,6 +679,8 @@ static void
|
|||||||
set_error_not_found (GError **error,
|
set_error_not_found (GError **error,
|
||||||
const char *path)
|
const char *path)
|
||||||
{
|
{
|
||||||
|
/* Avoid looking up the translation if it’s not going to be used. This is a hot path. */
|
||||||
|
if (error != NULL)
|
||||||
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…
x
Reference in New Issue
Block a user