mirror of
https://github.com/NixOS/nix
synced 2025-07-05 20:41:47 +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:
parent
9cfa78e58a
commit
46e942ff9e
16 changed files with 146 additions and 112 deletions
|
@ -27,15 +27,15 @@ std::map<StorePath, StorePath> makeContentAddressed(
|
|||
|
||||
StringMap rewrites;
|
||||
|
||||
PathReferences<StorePath> refs;
|
||||
refs.hasSelfReference = oldInfo->hasSelfReference;
|
||||
for (auto & ref : oldInfo->references) {
|
||||
StoreReferences refs;
|
||||
refs.self = oldInfo->references.self;
|
||||
for (auto & ref : oldInfo->references.others) {
|
||||
auto i = remappings.find(ref);
|
||||
auto replacement = i != remappings.end() ? i->second : ref;
|
||||
// FIXME: warn about unremapped paths?
|
||||
if (replacement != ref) {
|
||||
rewrites.insert_or_assign(srcStore.printStorePath(ref), srcStore.printStorePath(replacement));
|
||||
refs.references.insert(std::move(replacement));
|
||||
refs.others.insert(std::move(replacement));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue