[Lazarus] Help to find cause of crash in IDE after revision 19044

Luiz Americo Pereira Camara luizmed at oi.com.br
Sat Mar 21 23:30:31 CET 2009


On Sun, Mar 22, 2009 at 00:28, Lee Jenkins <lee at datatrakpos.com> wrote:
> Can anyone say why there is no string case statement in Object Pascal?  I've
> always wondered about this as sometimes it hard to avoid 10-20 If..then..else
> if.... statements.

I'd say it is because nobody contributed it ;-)

> Would the compiled code of a string case statement even be any more efficient or
> is the benefit mostly in code readability?

Both. It can be implemented as prefix tree,
giving O(MaxLength) instead of O(MaxLength*NumberOfCases) time _and_
a much better readability/maintainability.


-- 
Alexander S. Klenin




More information about the Lazarus mailing list