mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-27 04:32:15 +01:00
gkeyfile: Clarify behaviour of locales and checked_locales
This should introduce no functional changes, but will remove an unreachable branch in `g_key_file_locale_is_interesting()`: `checked_locales` indicates whether `locales` has been initialised (and it can be initialised to `NULL`), so there’s no point in checking `locales` itself if `checked_locales` is checked. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
f93f24e41c
commit
f471afb646
@ -511,8 +511,8 @@ struct _GKeyFile
|
|||||||
|
|
||||||
GKeyFileFlags flags;
|
GKeyFileFlags flags;
|
||||||
|
|
||||||
gboolean checked_locales;
|
gboolean checked_locales; /* TRUE if @locales has been initialised */
|
||||||
gchar **locales;
|
gchar **locales; /* (nullable) */
|
||||||
|
|
||||||
gint ref_count; /* (atomic) */
|
gint ref_count; /* (atomic) */
|
||||||
};
|
};
|
||||||
@ -1240,6 +1240,7 @@ g_key_file_locale_is_interesting (GKeyFile *key_file,
|
|||||||
|
|
||||||
if (!key_file->checked_locales)
|
if (!key_file->checked_locales)
|
||||||
{
|
{
|
||||||
|
g_assert (key_file->locales == NULL);
|
||||||
key_file->locales = g_strdupv ((gchar **)g_get_language_names ());
|
key_file->locales = g_strdupv ((gchar **)g_get_language_names ());
|
||||||
key_file->checked_locales = TRUE;
|
key_file->checked_locales = TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user