Skip to content

Commit d508d03

Browse files
committed
test: update doc in code
1 parent 9c00c2c commit d508d03

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/api/encoding.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ enum encoding ParseEncoding(const char* encoding,
1515
switch (encoding[0]) {
1616
case 'u':
1717
case 'U':
18-
// utf8, utf16le
18+
// Note: the two first conditions are needed for performance reasons
19+
// as "utf8"/"utf-8" is a common case.
20+
// (same for other cases below)
21+
22+
// utf, utf16le
1923
if (encoding[1] == 't' && encoding[2] == 'f') {
2024
// Skip `-`
2125
const size_t skip = encoding[3] == '-' ? 4 : 3;

0 commit comments

Comments
 (0)