diff options
author | Matt Turner <mattst88@gmail.com> | 2011-10-06 15:32:23 -0400 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2011-10-09 15:57:20 -0400 |
commit | a3696bd0798e9f40277b0b105764cea85650659a (patch) | |
tree | 46b9cf063afba76a3df953abe2946431a1600ad3 /src | |
parent | 942a17a30cffbe2e0208e486ae6e076a25fbeae3 (diff) |
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 <alan.coopersmith@oracle.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | 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) { |