79242358

Date: 2024-12-01 19:46:52
Score: 0.5
Natty:
Report link

If you need to handle MAX_ROWS being any number up to and including Float::Infinity, you can do the check explicitly with take_while plus with_index:

results_to_display = results.take_while.with_index {|result, index| index < MAX_ROWS }
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Muskworker