Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/strings/unicode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ isgraphemebreak(c1::AbstractChar, c2::AbstractChar) =
# Stateful grapheme break required by Unicode-9 rules: the string
# must be processed in sequence, with state initialized to Ref{Int32}(0).
# Requires utf8proc v2.0 or later.
function isgraphemebreak!(state::Ref{Int32}, c1::AbstractChar, c2::AbstractChar)
@inline function isgraphemebreak!(state::Ref{Int32}, c1::AbstractChar, c2::AbstractChar)
if ismalformed(c1) || ismalformed(c2)
state[] = 0
return true
Expand Down
2 changes: 2 additions & 0 deletions stdlib/Unicode/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ end
@test_throws BoundsError graphemes("äöüx", 2:5)
@test_throws BoundsError graphemes("äöüx", 5:5)
@test_throws ArgumentError graphemes("äöüx", 0:1)

@test @allocated(length(graphemes("äöüx"))) == 0
end

@testset "#3721, #6939 up-to-date character widths" begin
Expand Down