Commit b95df2a6cc506cb4e80734170d66c43e836e0ff1

Ran Benita 2014-02-15T22:59:12

expr: simplify ExprResolveButton Signed-off-by: Ran Benita <ran234@gmail.com>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index 7b6ecc9..c514f8d 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -427,14 +427,8 @@ ExprResolveLevel(struct xkb_context *ctx, const ExprDef *expr,
 bool
 ExprResolveButton(struct xkb_context *ctx, const ExprDef *expr, int *btn_rtrn)
 {
-    int result;
-
-    if (!ExprResolveIntegerLookup(ctx, expr, &result, SimpleLookup,
-                                  buttonNames))
-        return false;
-
-    *btn_rtrn = result;
-    return true;
+    return ExprResolveIntegerLookup(ctx, expr, btn_rtrn, SimpleLookup,
+                                    buttonNames);
 }
 
 bool