On 10/ 9/11 11:01 AM, Matt Turner wrote:
Was toupper() *really* expensive when this was written? :)

Also, initialize action_type with toupper(), since the check immediately
following assumes that its value is uppercase.

Signed-off-by: Matt Turner<[email protected]>
---
  src/Paned.c |    9 ++-------
  1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/Paned.c b/src/Paned.c
index aa925b6..2c4d476 100644
--- a/src/Paned.c
+++ b/src/Paned.c
@@ -1024,22 +1024,17 @@ HandleGrip(Widget grip, XtPointer junk, XtPointer 
callData)
      Direction direction = 0;
      Arg arglist[1];

-    action_type = *call_data->params[0];
+    action_type = toupper(*call_data->params[0]);

      if (call_data->num_params == 0                             ||
        (action_type == 'C'&&  call_data->num_params != 1)      ||
        (action_type != 'C'&&  call_data->num_params != 2))
                XtError( "Paned GripAction has been passed incorrect 
parameters." );

-    if (islower(action_type)) action_type = toupper(action_type);
-
      loc = GetEventLocation(pw, (XEvent *) (call_data->event));

      if (action_type != 'C') {
-       if ( isupper(*call_data->params[1]) )
-         direction = (Direction) *call_data->params[1];
-       else
-         direction = (Direction) toupper(*call_data->params[1]);
+       direction = (Direction) toupper(*call_data->params[1]);
      }

      switch (action_type) {

Reviewed-by: Alan Coopersmith <[email protected]>

--
        -Alan Coopersmith-        [email protected]
         Oracle Solaris Platform Engineering: X Window System

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to