From 2f4cd8c8c0a6565843293afea7857fc41e8c3e39 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Thu, 10 Mar 2011 17:56:31 +0000 Subject: [PATCH] 2011-03-10 18:56 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/pp/ppcore.c % small optimization --- harbour/ChangeLog | 4 ++++ harbour/src/pp/ppcore.c | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 15253c69f3..9fde38b1d5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2011-03-10 18:56 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/src/pp/ppcore.c + % small optimization + 2011-03-10 17:12 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbpp.h * harbour/include/hbvmpub.h diff --git a/harbour/src/pp/ppcore.c b/harbour/src/pp/ppcore.c index 9b6b79d900..da41b63b92 100644 --- a/harbour/src/pp/ppcore.c +++ b/harbour/src/pp/ppcore.c @@ -272,8 +272,9 @@ static const HB_PP_OPERATOR * hb_pp_operatorFind( PHB_PP_STATE pState, while( --i >= 0 ) { - if( pOperator->len <= nLen && - hb_strnicmp( pOperator->name, buffer, pOperator->len ) == 0 ) + if( pOperator->len <= nLen && pOperator->name[ 0 ] == buffer[ 0 ] && + ( pOperator->len == 1 || + hb_strnicmp( pOperator->name + 1, buffer + 1, pOperator->len - 1 ) == 0 ) ) return pOperator; ++pOperator; @@ -284,8 +285,12 @@ static const HB_PP_OPERATOR * hb_pp_operatorFind( PHB_PP_STATE pState, do { - if( pOperator->len <= nLen && - hb_strnicmp( pOperator->name, buffer, pOperator->len ) == 0 ) + if( pOperator->len <= nLen && pOperator->name[ 0 ] == buffer[ 0 ] && + ( pOperator->len == 1 || + ( pOperator->len >= 4 ? + hb_strnicmp( pOperator->name + 1, buffer + 1, pOperator->len - 1 ) == 0 : + ( pOperator->name[ 1 ] == buffer[ 1 ] && + ( pOperator->len == 2 || pOperator->name[ 2 ] == buffer[ 2 ] ) ) ) ) ) return pOperator; ++pOperator;