xfree86/parser: reuse StringToToken() in xf86getToken()

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
Emil Velikov 2016-04-17 20:30:45 +01:00 committed by Adam Jackson
parent 944ea03d5b
commit 537276a5b8

View File

@ -441,14 +441,8 @@ xf86getToken(const xf86ConfigSymTabRec * tab)
/*
* Joop, at last we have to lookup the token ...
*/
if (tab) {
i = 0;
while (tab[i].token != -1)
if (xf86nameCompare(configRBuf, tab[i].name) == 0)
return tab[i].token;
else
i++;
}
if (tab)
return StringToToken(configRBuf, tab);
return ERROR_TOKEN; /* Error catcher */
}