Skip to content

Commit d94bb62

Browse files
committed
Merge pull request #11790 from JuliaLang/ob/asciigi
Avoid a branch in `getindex(::ASCIIString,::Int)`
2 parents a94da23 + cf2f54f commit d94bb62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/ascii.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
## required core functionality ##
1111

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

1515
## overload methods for efficiency ##
1616

0 commit comments

Comments
 (0)