Subject: | ihead doesn't test for exhaustion properly |
line 195, in the ihead() function :
Iterator::is_done if $num <= 0;
That means that the ihead() will report exhaustion as soon as $num
values have been returned. That's all good, except when $iter contains
*less* elements than $num. In this case, exhaustion is not properly
reported. I propose the line to be changed into :
Iterator::is_done if $num <= 0 || $iter->is_exhausted();