Skip to content

Commit

Permalink
Merge pull request #11790 from JuliaLang/ob/asciigi
Browse files Browse the repository at this point in the history
Avoid a branch in `getindex(::ASCIIString,::Int)`
  • Loading branch information
carnaval committed Jun 21, 2015
2 parents a94da23 + cf2f54f commit d94bb62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/ascii.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
## required core functionality ##

endof(s::ASCIIString) = length(s.data)
getindex(s::ASCIIString, i::Int) = (x=s.data[i]; x < 0x80 ? Char(x) : '\ufffd')
getindex(s::ASCIIString, i::Int) = (x=s.data[i]; ifelse(x < 0x80, Char(x), '\ufffd'))

## overload methods for efficiency ##

Expand Down

0 comments on commit d94bb62

Please sign in to comment.