We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 222b6f4 commit 430f7f6Copy full SHA for 430f7f6
1 file changed
src/base.jl
@@ -30,6 +30,9 @@ function ShortString{T}(s::ShortString{S}) where {T, S}
30
sz = sizeof(s)
31
check_size(T, sz)
32
# Flip it so empty bytes are at start, grow/shrink it, flip it back
33
+ # S(size_mask(S)) will return a mask for getting the size for Shorting Strings in (content size)
34
+ # format, so something like 00001111 in binary.
35
+ # ~S(size_mask(S))) will yield 11110000 which can be used as maks to extract the content
36
content = ntoh(T(ntoh(s.size_content & ~S(size_mask(S)))))
37
ShortString{T}(content | T(sz))
38
end
0 commit comments