summaryrefslogtreecommitdiff
path: root/hw/xfree86/parser
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2016-04-17 20:30:45 +0100
committerAdam Jackson <ajax@redhat.com>2016-04-18 11:36:43 -0400
commit537276a5b86b7341169ea4eb36d479a503ba5d84 (patch)
treee1aa10c6a7fc9ab0b33973ffba3d4103a6afeee9 /hw/xfree86/parser
parent944ea03d5be2ffe22a3f1c4c287760261c31235f (diff)
xfree86/parser: reuse StringToToken() in xf86getToken()
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'hw/xfree86/parser')
-rw-r--r--hw/xfree86/parser/scan.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index 5c2e4ae74..81a454b23 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -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 */
}