Skip to content

Commit

Permalink
add iteratorsize(::Type{StreamMapIterator}) and cleanup from rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 18, 2016
1 parent 48340a8 commit f22e84e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/iterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _min_length(a, b, A, B) = min(length(a),length(b))
_diff_length(a, b, A, ::IsInfinite) = 0
_diff_length(a, b, ::IsInfinite, ::IsInfinite) = 0
_diff_length(a, b, ::IsInfinite, B) = length(a) # inherit behaviour, error
_diff_length(a, b, A, B) = max(length(a)-length(b), 0)
_diff_length(a, b, A, B) = max(length(a)-length(b), 0)

# enumerate

Expand Down
2 changes: 2 additions & 0 deletions base/mapiterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,5 @@ function next(itr::StreamMapIterator, state::StreamMapState)

return (r, state)
end

iteratorsize(::Type{StreamMapIterator}) = SizeUnknown()
2 changes: 1 addition & 1 deletion test/functional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ let s = "hello"
@test collect(rest(s, st)) == ['e','l','l','o']
end

@test_throws MethodError collect(rest(countfrom(1), 5))
@test_throws MethodError collect(rest(countfrom(1), 5))

# countfrom
# ---------
Expand Down

0 comments on commit f22e84e

Please sign in to comment.