Skip to content

Commit

Permalink
Revert "faster string() for ASCIIString. helps #2050"
Browse files Browse the repository at this point in the history
This reverts commit dc86b8d.
  • Loading branch information
ViralBShah committed Jul 2, 2013
1 parent 655524d commit 57ad0dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
17 changes: 2 additions & 15 deletions base/ascii.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,8 @@ getindex(s::ASCIIString, r::Range1{Int}) = ASCIIString(getindex(s.data,r))
getindex(s::ASCIIString, indx::AbstractVector{Int}) = ASCIIString(s.data[indx])
search(s::ASCIIString, c::Char, i::Integer) = c < 0x80 ? search(s.data,uint8(c),i) : 0
rsearch(s::ASCIIString, c::Char, i::Integer) = c < 0x80 ? rsearch(s.data,uint8(c),i) : 0

function string(c::ASCIIString...)
n = 0
for s in c
n += length(s.data)
end
v = Array(Uint8,n)
o = 1
for s in c
ls = length(s.data)
unsafe_copy!(v, o, s.data, 1, ls)
o += ls
end
ASCIIString(v)
end
string(a::ASCIIString, b::ASCIIString, c::ASCIIString...) =
ASCIIString([a.data,b.data,map(s->s.data,c)...])

function ucfirst(s::ASCIIString)
if 'a' <= s[1] <= 'z'
Expand Down
2 changes: 0 additions & 2 deletions base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ end
# all subtypes should implement this
write(s::IO, x::Uint8) = error(typeof(s)," does not support byte I/O")

write(io::IO, xs...) = for x in xs write(io, x) end

if ENDIAN_BOM == 0x01020304
function write(s::IO, x::Integer)
sz = sizeof(x)
Expand Down

1 comment on commit 57ad0dd

@ViralBShah
Copy link
Member Author

Choose a reason for hiding this comment

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

I reverted this since it broke the build. sys.ji is not building on mac, and Travis is showing failures too.

Please sign in to comment.