Skip to content

Commit

Permalink
Update base/strings/unicode.jl
Browse files Browse the repository at this point in the history
Annotate `@ccall` macro

Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
  • Loading branch information
jishnub and aviatesk committed May 7, 2024
1 parent 4fc39d4 commit 6acb90d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions base/strings/unicode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,8 @@ julia> islowercase('❤')
false
```
"""
function islowercase(c::AbstractChar)
if ismalformed(c)
false
else
ui = UInt32(c)::UInt32 # type-assertion to ensure that we may assume :foldable
@assume_effects :foldable Bool(ccall(:utf8proc_islower, Cint, (UInt32,), ui))
end
end
islowercase(c::AbstractChar) = ismalformed(c) ? false :
Bool(@assume_effects :foldable @ccall utf8proc_islower(UInt32(c)::UInt32)::Cint)

# true for Unicode upper and mixed case

Expand Down

0 comments on commit 6acb90d

Please sign in to comment.