(lookup_key): minor refactoring: replace while() by for().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2013-08-07 13:48:54 +04:00
parent 546e89f611
commit bb142bf47f
1 changed files with 2 additions and 5 deletions

View File

@ -1471,10 +1471,10 @@ lookup_key (const char *name, char **label)
return 0;
name = g_strstrip (g_strdup (name));
p = lc_keys = g_strsplit_set (name, "-+ ", -1);
lc_keys = g_strsplit_set (name, "-+ ", -1);
g_free ((char *) name);
while ((p != NULL) && (*p != NULL))
for (p = lc_keys; p != NULL && *p != NULL; p++)
{
if ((*p)[0] != '\0')
{
@ -1495,8 +1495,6 @@ lookup_key (const char *name, char **label)
break;
}
}
p++;
}
g_strfreev (lc_keys);
@ -1505,7 +1503,6 @@ lookup_key (const char *name, char **label)
if (k <= 0)
return 0;
if (label != NULL)
{
GString *s;