Skip to content

Commit

Permalink
Skip scanning for surrogates when not known valid
Browse files Browse the repository at this point in the history
  • Loading branch information
thaliaarchi committed Feb 20, 2025
1 parent 0842f2c commit eb14652
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sys_common/wtf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ impl Wtf8Buf {
_ => {
// If we'll be pushing a string containing a surrogate, we may
// no longer have UTF-8.
if other.next_surrogate(0).is_some() {
if self.is_known_utf8 && other.next_surrogate(0).is_some() {
self.is_known_utf8 = false;
}

Expand Down

0 comments on commit eb14652

Please sign in to comment.