From d8b9bde9da91cc4ebc69c9a13bb408ca939c1880 Mon Sep 17 00:00:00 2001 From: Kevin Squire Date: Tue, 18 Feb 2020 10:56:58 -0800 Subject: [PATCH] Add codeunit(s::ShortString) * Confusingly, this should return the type of `codeunit(s, i)` --- src/ShortStrings.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ShortStrings.jl b/src/ShortStrings.jl index ac4354c..cb5284f 100644 --- a/src/ShortStrings.jl +++ b/src/ShortStrings.jl @@ -23,6 +23,7 @@ end String(s::ShortString) = String(reinterpret(UInt8, [s.size_content|>ntoh])[1:sizeof(s)]) +Base.codeunit(s::ShortString) = codeunit(String(s)) Base.codeunit(s::ShortString, i) = codeunits(String(s), i) Base.codeunit(s::ShortString, i::Integer) = codeunit(String(s), i) Base.codeunits(s::ShortString) = codeunits(String(s))