From a3696bd0798e9f40277b0b105764cea85650659a Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 6 Oct 2011 15:32:23 -0400 Subject: Remove worthless isupper/islower checks 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. Reviewed-by: Alan Coopersmith Signed-off-by: Matt Turner --- src/Paned.c | 9 ++------- 1 file 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) { -- cgit v1.2.3