perf(regexp): remove unnecessary sort (#1402)

This commit is contained in:
magic-akari 2023-11-18 13:28:55 +08:00 committed by GitHub
parent 75eb708526
commit f5894b636b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1869,16 +1869,15 @@ impl<'a> Format<'a> for RegExpFlags {
if self.contains(Self::S) {
string.push('s');
}
if self.contains(Self::V) {
string.push('v');
}
if self.contains(Self::U) {
string.push('u');
}
if self.contains(Self::V) {
string.push('v');
}
if self.contains(Self::Y) {
string.push('y');
}
string.sort_unstable();
p.str(&string.iter().collect::<String>())
}
}