[PATCH xserver 3/4] xfree86/parser: reuse StringToToken() in xf86getToken()

Emil Velikov emil.l.velikov at gmail.com
Sun Apr 17 19:30:45 UTC 2016


Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 hw/xfree86/parser/scan.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index 5c2e4ae..81a454b 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 */
 }
-- 
2.8.0



More information about the xorg-devel mailing list