in reply to Re^9: Benchmarking "Are all these characters in this sentence?" (Broken tests, not code!)
in thread Benchmarking "Are all these characters in this sentence?"

Fixed with a !!, thanks.

No, that didn't do it. I'm getting undef where a true return is expected...

Ah, I see. You had -1 ==, I think you meant -1 !=...

buk4 => sub { ( -1 != index $_[0], chop $_[ 1 ] ) || return for 1 .. length +$_[ 1 ]; 1; },
Once I made that change, it passes all the tests (which are now updated to check truth values) and it does win the speed crown by a 1% (on Short) to 11% (on LongLong) margin over buk3 (on perl 5.8.4 - I don't have my mac handy).

Mike
  • Comment on Re^10: Benchmarking "Are all these characters in this sentence?" (Broken tests, not code!)
  • Download Code