mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 09:23:05 +00:00
Preallocate a buffer in FmtPrinter
This commit is contained in:
parent
efb99d780d
commit
2ee6d55c62
@ -1583,7 +1583,9 @@ impl<'a, 'tcx> FmtPrinter<'a, 'tcx> {
|
||||
pub fn new(tcx: TyCtxt<'tcx>, ns: Namespace) -> Self {
|
||||
FmtPrinter(Box::new(FmtPrinterData {
|
||||
tcx,
|
||||
fmt: String::new(),
|
||||
// Estimated reasonable capacity to allocate upfront based on a few
|
||||
// benchmarks.
|
||||
fmt: String::with_capacity(64),
|
||||
empty_path: false,
|
||||
in_value: ns == Namespace::ValueNS,
|
||||
print_alloc_ids: false,
|
||||
|
Loading…
Reference in New Issue
Block a user