compact_str icon indicating copy to clipboard operation
compact_str copied to clipboard

Some slightly performance & style updates

Open yhx-12243 opened this issue 11 months ago • 3 comments

  • In the function fn as_bytes in impl CompactString, there is an redundant slicing (with a self.len() call) which is unnecessary after the update c95edd5.
  • This crate has documented that for 64-bit architectures the capacity will be always inlined. So the logic of is_heap can be replaced with directly returning false to reduce some code generation.

yhx-12243 avatar Mar 10 '24 19:03 yhx-12243