2000-08-22 10:40 UTC+0800 Ron Pinkas <ron@profit-master.com>

* source/compiler/simplex.c
   * source/compiler/harbour.slx
   * source/macro/macro.slx
     ! Removed un-needed calls to strlen().
This commit is contained in:
Ron Pinkas
2000-08-22 17:39:34 +00:00
parent fb446913e1
commit ce87f32df5
4 changed files with 16 additions and 10 deletions

View File

@@ -1,3 +1,9 @@
2000-08-22 10:40 UTC+0800 Ron Pinkas <ron@profit-master.com>
* source/compiler/simplex.c
* source/compiler/harbour.slx
* source/macro/macro.slx
! Removed un-needed calls to strlen().
2000-08-21 15:45 UTC+0800 Ron Pinkas <ron@profit-master.com>
* source/compiler/simplex.c
! Optimized Keywords and Words search, Lexer is ~5% faster.

View File

@@ -852,7 +852,7 @@ LANGUAGE_RULES_ARE {
else\
{\
yytext = x;\
yyleng = strlen( yytext );\
yyleng = iLen;\
\
if( *yytext == '_' || *yytext == '&' || isalpha( (int) *yytext ) )\
{\
@@ -909,7 +909,7 @@ LANGUAGE_RULES_ARE {
{\
DEBUG_INFO( printf( "Element \"%s\" is IDENTIFIER\n", yytext ) );\
\
if( strlen( yytext ) > HB_SYMBOL_NAME_LEN )\
if( iLen > HB_SYMBOL_NAME_LEN )\
{\
yytext[ HB_SYMBOL_NAME_LEN ] = '\0';\
yyleng = HB_SYMBOL_NAME_LEN;\
@@ -986,7 +986,7 @@ LANGUAGE_RULES_ARE {
if( tmpPtr )\
{\
yylval.valDouble.bDec = strlen( tmpPtr + 1 );\
yylval.valDouble.bWidth = strlen( yytext ) - yylval.valDouble.bDec;\
yylval.valDouble.bWidth = iLen - yylval.valDouble.bDec;\
if( yylval.valDouble.bDec )\
{\
yylval.valDouble.bWidth--;\
@@ -1010,7 +1010,7 @@ LANGUAGE_RULES_ARE {
}\
else\
{\
yylval.valDouble.bWidth = strlen( yytext ) + 1;\
yylval.valDouble.bWidth = iLen + 1;\
yylval.valDouble.bDec = 0;\
yylval.valDouble.szValue = yytext;\
iRet = NUM_DOUBLE;\

View File

@@ -1227,7 +1227,7 @@ YY_DECL
bIgnoreWords = FALSE;
#ifdef LEX_ABBREVIATE_KEYS
iWordLen = strlen( (char*) sToken );
iWordLen = iLen;
if( iWordLen < LEX_ABBREVIATE_KEYS )
{
@@ -1287,7 +1287,7 @@ YY_DECL
else
{
#ifdef LEX_ABBREVIATE_WORDS
iWordLen = strlen( (char*) sToken );
iWordLen = iLen;
if( iWordLen < LEX_ABBREVIATE_WORDS )
{

View File

@@ -242,7 +242,7 @@ LANGUAGE_RULES_ARE {
#undef ELEMENT_TOKEN
#define ELEMENT_TOKEN(x)\
{ yytext = x;\
yyleng = strlen( yytext );\
yyleng = iLen;\
\
if( *yytext == '_' || *yytext == '&' || isalpha( (int) *yytext ) )\
{\
@@ -297,7 +297,7 @@ LANGUAGE_RULES_ARE {
}\
else\
{\
if( ( USHORT ) strlen( yytext ) > YYLEX_PARAM->uiNameLen )\
if( iLen > YYLEX_PARAM->uiNameLen )\
{\
yytext[ YYLEX_PARAM->uiNameLen ] = '\0';\
yyleng = YYLEX_PARAM->uiNameLen;\
@@ -341,7 +341,7 @@ LANGUAGE_RULES_ARE {
if( tmpPtr )\
{\
yylval_ptr->valDouble.bDec = strlen( tmpPtr + 1 );\
yylval_ptr->valDouble.bWidth = strlen( yytext ) - yylval_ptr->valDouble.bDec;\
yylval_ptr->valDouble.bWidth = iLen - yylval_ptr->valDouble.bDec;\
if( yylval_ptr->valDouble.bDec )\
{\
yylval_ptr->valDouble.bWidth--;\
@@ -359,7 +359,7 @@ LANGUAGE_RULES_ARE {
}\
else\
{\
yylval_ptr->valDouble.bWidth = strlen( yytext ) + 1;\
yylval_ptr->valDouble.bWidth = iLen + 1;\
yylval_ptr->valDouble.bDec = 0;\
yylval_ptr->valDouble.szValue = yytext;\
iRet = NUM_DOUBLE;\