79791134

Date: 2025-10-15 11:57:35
Score: 1
Natty:
Report link

Both versions compile to nearly identical bytecode, so the else isn’t what speeds things up. The small timing difference comes from how CPython handles sets internally and from random cache or branch-prediction effects at the C level, not from Python’s control flow. In short, it’s just measurement noise — not a real optimization. Use whichever version reads clearer.

Reasons:
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Floyd Marks