fix(tvix/nix-compat): don't transiently allocate names
The point of clearing and reusing the same Vec is to avoid transiently allocating for every directory entry. This was lost in cl/8974 when we switched from String to Vec<u8>. Change-Id: I65647e5c4e54e88f1fe45e9a752cb5154d98fb33 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9607 Autosubmit: edef <edef@edef.eu> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
eb167c71a7
commit
49b106b0cb
1 changed files with 1 additions and 1 deletions
|
@ -188,7 +188,7 @@ impl<'a, 'w> Directory<'a, 'w> {
|
|||
"misordered names: {_prev_name:?} >= {name:?}"
|
||||
);
|
||||
_prev_name.clear();
|
||||
_prev_name.append(&mut name.to_vec());
|
||||
_prev_name.extend_from_slice(name);
|
||||
}
|
||||
self.node.write(&wire::TOK_PAR)?;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue