mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
perf(allocator/bitset): avoid temp heap String allocation (#22403)
admittedly this is a bit unnecessary, but no harm in optimizing it.
This commit is contained in:
1 parent
5478fb5aad
commit
73a9043bf4
1 file changed
+3
-3
@@ -120,10 +120,10 @@ impl Display for BitSet<'_> {
|
||||
}
|
||||
|
||||
let highest_byte = bytes.next().unwrap();
|
||||
f.write_str(&format!("{highest_byte:08b}"))?;
|
||||
write!(f, "{highest_byte:08b}")?;
|
||||
|
||||
for byte in bytes {
|
||||
f.write_str(&format!("_{byte:08b}"))?;
|
||||
write!(f, "_{byte:08b}")?;
|
||||
}
|
||||
|
||||
// Print remaining `usize`s without skipping any bytes
|
||||
@@ -135,7 +135,7 @@ impl Display for BitSet<'_> {
|
||||
let bytes = bytes.iter();
|
||||
|
||||
for byte in bytes {
|
||||
f.write_str(&format!("_{byte:08b}"))?;
|
||||
write!(f, "_{byte:08b}")?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user