mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-28 13:12: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++;
|
from++;
|
||||||
if (*from == '#')
|
if (*from == '#')
|
||||||
{
|
{
|
||||||
gboolean is_hex = FALSE;
|
gint base = 10;
|
||||||
gulong l;
|
gulong l;
|
||||||
gchar *end = NULL;
|
gchar *end = NULL;
|
||||||
|
|
||||||
@ -665,16 +665,13 @@ unescape_gstring_inplace (GMarkupParseContext *context,
|
|||||||
|
|
||||||
if (*from == 'x')
|
if (*from == 'x')
|
||||||
{
|
{
|
||||||
is_hex = TRUE;
|
base = 16;
|
||||||
from++;
|
from++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* digit is between start and p */
|
/* digit is between start and p */
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if (is_hex)
|
l = strtoul (from, &end, base);
|
||||||
l = strtoul (from, &end, 16);
|
|
||||||
else
|
|
||||||
l = strtoul (from, &end, 10);
|
|
||||||
|
|
||||||
if (end == from || errno != 0)
|
if (end == from || errno != 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user