mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-28 05:02:10 +01:00
markup: trivial refactor
Avoid an unnecessary branch.
This commit is contained in:
parent
d28639507d
commit
5644ee5083
@ -657,7 +657,7 @@ unescape_gstring_inplace (GMarkupParseContext *context,
|
||||
from++;
|
||||
if (*from == '#')
|
||||
{
|
||||
gboolean is_hex = FALSE;
|
||||
gint base = 10;
|
||||
gulong l;
|
||||
gchar *end = NULL;
|
||||
|
||||
@ -665,16 +665,13 @@ unescape_gstring_inplace (GMarkupParseContext *context,
|
||||
|
||||
if (*from == 'x')
|
||||
{
|
||||
is_hex = TRUE;
|
||||
base = 16;
|
||||
from++;
|
||||
}
|
||||
|
||||
/* digit is between start and p */
|
||||
errno = 0;
|
||||
if (is_hex)
|
||||
l = strtoul (from, &end, 16);
|
||||
else
|
||||
l = strtoul (from, &end, 10);
|
||||
l = strtoul (from, &end, base);
|
||||
|
||||
if (end == from || errno != 0)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user