1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 11:41:15 +02:00

Do big rename to clean up code

- `PathReferences` -> `References`

- `PathReferences<StorePath>` -> `StoreReference`

- `references` -> `others`

- `hasSelfReference` -> `self`

And get rid of silly subclassing
This commit is contained in:
John Ericson 2023-01-06 15:36:05 -05:00
parent 9cfa78e58a
commit 46e942ff9e
16 changed files with 146 additions and 112 deletions

View file

@ -180,8 +180,9 @@ ref<const ValidPathInfo> BinaryCacheStore::addToStoreCommon(
duration);
/* Verify that all references are valid. This may do some .narinfo
reads, but typically they'll already be cached. */
for (auto & ref : info.references)
reads, but typically they'll already be cached. Note that
self-references are always valid. */
for (auto & ref : info.references.others)
try {
queryPathInfo(ref);
} catch (InvalidPath &) {
@ -314,8 +315,8 @@ StorePath BinaryCacheStore::addToStoreFromDump(Source & dump, std::string_view n
.hash = nar.first,
},
.references = {
.references = references,
.hasSelfReference = false,
.others = references,
.self = false,
},
},
},
@ -434,8 +435,8 @@ StorePath BinaryCacheStore::addToStore(
.hash = h,
},
.references = {
.references = references,
.hasSelfReference = false,
.others = references,
.self = false,
},
},
},