in reply to Re: Re: Perl Idioms Explained: && and || "Short Circuit" operators
in thread Perl Idioms Explained - && and || "Short Circuit" operators
Now you've confused me:)
Doesn't O(1) (in this case) mean that a condition is only tested once with the C-switch statement. Whereas the implementation shown in the OP, all tests from 0 to N where N is the met condition's lexical position within the group, hence worst case O(N) if the last case is the one chosen?
It was this bit of your post that confused me
...Im wracking my brain to see how this could be done without becoming hopelessly inefficient....
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: Perl Idioms Explained: && and || "Short Circuit" operators
by demerphq (Chancellor) on Oct 22, 2003 at 23:30 UTC | |
by BrowserUk (Patriarch) on Oct 22, 2003 at 23:56 UTC | |
by demerphq (Chancellor) on Oct 23, 2003 at 00:13 UTC | |
by BrowserUk (Patriarch) on Oct 23, 2003 at 00:49 UTC | |
by demerphq (Chancellor) on Oct 23, 2003 at 12:25 UTC | |
|