diff options
author | edef <edef@edef.eu> | 2024-05-08T07·13+0000 |
---|---|---|
committer | edef <edef@edef.eu> | 2024-05-08T15·30+0000 |
commit | 31d73cd443311c5ef4bfbd8c2b66e3b9691340ec (patch) | |
tree | 906c13131daf87bcc726db9453c8226d68a3728b /tvix/store/src | |
parent | 17a7dac94f29d8151ecebfbf11d5b83cf0c4f415 (diff) |
refactor(nix-compat/nar/reader): reuse prev_name allocation r/8095
We reuse the prev_name allocation for Entry, instead of allocating and returning a separate Vec. We encode the `prev_name: None` case as an empty vector, since we don't allow empty names anyway, and the sorting is equivalent. Change-Id: I975b37ff873805f5ff099bc82128706891052247 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11607 Reviewed-by: Brian Olsen <me@griff.name> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src')
-rw-r--r-- | tvix/store/src/nar/import.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/store/src/nar/import.rs b/tvix/store/src/nar/import.rs index 7a9f1231e76a..3d7c50014aa8 100644 --- a/tvix/store/src/nar/import.rs +++ b/tvix/store/src/nar/import.rs @@ -87,7 +87,7 @@ where let mut path = path.clone(); // valid NAR names are valid castore names - path.try_push(&entry.name) + path.try_push(entry.name) .expect("Tvix bug: failed to join name"); let entry = Box::pin(produce_nar_inner( |