[fpc-pascal]Word count function
jonas at zeus.rug.ac.be
Tue Oct 2 17:32:37 CEST 2001
On dinsdag, oktober 2, 2001, at 05:08 , Barry Kelly wrote:
>> Much faster? Boy, was that an understatement. [...] But I must confess
>> that I don't know exactly why there would be such a huge difference.
>> is a "set of char" soooo much faster then a const?
> Because Pascal isn't C. :-) Pascal has this concept built in; Pos checks
> for a string in another string, it isn't optimized for just a character.
We do have a separate version of pos for use with a character as first
parameter. The reason it's much faster has been already explained with
someone else (set ~ array[char] of boolean)
More information about the fpc-pascal