Skip to content

Commit 430f7f6

Browse files
authored
Update src/base.jl
1 parent 222b6f4 commit 430f7f6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/base.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ function ShortString{T}(s::ShortString{S}) where {T, S}
3030
sz = sizeof(s)
3131
check_size(T, sz)
3232
# 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
3336
content = ntoh(T(ntoh(s.size_content & ~S(size_mask(S)))))
3437
ShortString{T}(content | T(sz))
3538
end

0 commit comments

Comments
 (0)