Re: Dictionary - StewartML

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Monday 27 October 2003 05:35 pm, you wrote:
>
> Hi Irv,
>
> Thanks for looking at that; i hope to use this myself soon.
>
> I just have one note to add...
>
> When stripping off the end character, wouldnt it be faster
> to simply check the last character:
>
> while temp[length(temp)]=10 do
>     temp = temp[1..length(temp) - 1]
> end while
>
> Something like that?
> You wouldnt need find() that way, which looks at every
> single character in the line.

Yes, it's slightly faster (about 10%). 
Since you have to check for both 13 and 10, the fastest seems to be:
 while temp[length(temp)] < 14 do

Anybody know a better way?

Regards,
Irv

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu