forked from JuliaStrings/InlineStrings.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I was looking into fixing JuliaStrings#15 but realized that the special casing of `InlineString1` to only have one byte makes that not work. I would say that the current special casing of `InlineString1` creates quite a bit of confusing behavior: ``` julia> InlineString("") |> typeof String3 julia> InlineString("a") |> typeof String1 ``` Why would an empty string take more place than a one letter string? ``` julia> String1("") ERROR: ArgumentError: string too large (0) to convert to String1 Stacktrace: [1] stringtoolong(T::Type, n::Int64) @ InlineStrings ~/.julia/packages/InlineStrings/xUsry/src/InlineStrings.jl:321 [2] String1(x::String) @ InlineStrings ~/.julia/packages/InlineStrings/xUsry/src/InlineStrings.jl:208 [3] top-level scope @ REPL[4]:1 julia> String3("") "" ``` Wut? There is nothing in the documentation that indicates this type of special behavior. I'm sure there is some reason for doing this since so much pain seems to have been gone through to do it but I thought I would put up this PR nonetheless. Fixes JuliaStrings#73 Fixes JuliaStrings#72
- Loading branch information
1 parent
3458995
commit c8123aa
Showing
3 changed files
with
32 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.