The existing code is needlessly hard to follow. It should return
immediately upon success, and unconditionally bail if it never
succeeded.

Signed-off-by: Jason Gerecke <killert...@gmail.com>
---
 src/wcmXCommand.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index 091697d..6dd6c58 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -320,12 +320,9 @@ static int wcmFindProp(Atom property, Atom *prop_list, int 
nprops)
        /* check all properties used for button actions */
        for (i = 0; i < nprops; i++)
                if (prop_list[i] == property)
-                       break;
+                       return i;
 
-       if (i >= nprops)
-               return -BadAtom;
-
-       return i;
+       return -BadAtom;
 }
 
 /**
-- 
1.8.1.1


------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to