Hi

xMen wrote:
> 
> Hola Pritpal  veo que usas mucho len( a ) dentro de los bucles y eso se 
> evalua en cada iteración.
> Por ejemplo MemoToArray quedaría más optimizada así:
> 

I can understand English only, but no problem, I can sense what you mean.



> FUNCTION MemoToArray( s )
>    LOCAL a_, b_, i, j, n
> 
>    s := trim( s )
>    s := strtran( s, CRLF, _EOL )
>    a_:= hb_atokens( s, _EOL )
>    n := len( a_ )        // <----------------------
> 
>    FOR i := n TO 1 step -1
>       IF !empty( a_[ i ] )
>          EXIT
>       ENDIF
>    NEXT
>    IF i < n
>       b_ := Array( i )          // <----------------------
>       FOR j := 1 TO i
>          b_ := a_[ j ]
>       NEXT
>    ENDIF
> 
>    RETURN b_
> 

Thanks for this optimization, applied with little change : 
     b_:= a_[ j ] => b_[ j ] := a_[ j ]

Regards
Pritpal Bedi



-- 
View this message in context: 
http://old.nabble.com/SF.net-SVN%3A-harbour-project%3A-13135--trunk-harbour-tp26658015p26661883.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to