3 ms·
And it's worth pointing out that the above is also slow whether you depend on exceptions or just the long if version, and depends on having methods with no side
by vidarh 11y ago
And it's worth pointing out that the above is also slow whether you depend on exceptions or just the long if version, and depends on having methods with no side-effects, as several methods gets called multiple times.
As far as I see the proposed version will work equivalent to assigning the result of each method invocation to a temporary, and doing the next check on that, which gets far more ugly if you have to write it out