Skip to content

Commit

Permalink
add IteratorSize for Char (#29819)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins authored and KristofferC committed Nov 13, 2018
1 parent b4d8795 commit 9eda36f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/char.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ size(c::AbstractChar,d) = convert(Int, d) < 1 ? throw(BoundsError()) : 1
ndims(c::AbstractChar) = 0
ndims(::Type{<:AbstractChar}) = 0
length(c::AbstractChar) = 1
IteratorSize(::Type{Char}) = HasShape{0}()
firstindex(c::AbstractChar) = 1
lastindex(c::AbstractChar) = 1
getindex(c::AbstractChar) = c
Expand Down
4 changes: 4 additions & 0 deletions test/char.jl
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,7 @@ end
@test reinterpret(UInt32, reinterpret(Char, u)) === u
end
end

@testset "broadcasting of Char" begin
@test identity.('a') == 'a'
end

2 comments on commit 9eda36f

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.