Skip to content

Commit d82775b

Browse files
bscuronmawww
authored andcommitted
Skip call to wcwidth for ascii in codepoint_width
1 parent 71ebc48 commit d82775b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unicode.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ inline bool is_identifier(Codepoint c) noexcept
101101

102102
inline ColumnCount codepoint_width(Codepoint c) noexcept
103103
{
104-
if (c == '\n')
104+
if (c < 0x80) [[likely]]
105105
return 1;
106106
const auto width = wcwidth((wchar_t)c);
107107
return width >= 0 ? width : 1;

0 commit comments

Comments
 (0)