Skip to content

Commit

Permalink
reinstate "useless" String() inner constructor (#16212)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed May 5, 2016
1 parent 280310d commit 2309198
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ abstract DirectIndexString <: AbstractString

immutable String <: AbstractString
data::Array{UInt8,1}
# required to make String("foo") work (#15120):
String(d::Array{UInt8,1}) = new(d)
end

include(fname::String) = ccall(:jl_load_, Any, (Any,), fname)
Expand Down
4 changes: 4 additions & 0 deletions test/strings/basic.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

# constructors
@test String([0x61,0x62,0x63,0x21]) == "abc!"
@test String("abc!") == "abc!"

# {starts,ends}with
@test startswith("abcd", 'a')
@test startswith("abcd", "a")
Expand Down

3 comments on commit 2309198

@jrevels
Copy link
Member

@jrevels jrevels commented on 2309198 May 9, 2016

Choose a reason for hiding this comment

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

Prompted by here:

@nanosoldier runbenchmarks(ALL, vs = "@90de0283decd4d6b8772fad403f2ce9feab6ada8")

...It would be nice to have Nanosoldier realize I'm in a commit context, and update all statuses via comment (since GitHub's UI doesn't display the status icons here AFAICT).

@jrevels
Copy link
Member

@jrevels jrevels commented on 2309198 May 9, 2016

Choose a reason for hiding this comment

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

Confirmed the job is running, Nanosoldier should reply with a comment here when it finishes.

@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 @jrevels

Please sign in to comment.