mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 04:00:59 +01:00
Before adjusting getStateReferencesClosure_
This commit is contained in:
parent
bc0af4449a
commit
184443d18d
7 changed files with 144 additions and 43 deletions
|
|
@ -1117,5 +1117,28 @@ string getCallingUserName()
|
|||
//return "root6";
|
||||
return username;
|
||||
}
|
||||
|
||||
PathSet mergePathSets(const PathSet & paths1, const PathSet & paths2)
|
||||
{
|
||||
PathSet merged = paths2;
|
||||
|
||||
for (PathSet::iterator i = paths1.begin(); i != paths1.end(); ++i) //were inserting all paths from pathset1 into pathset2
|
||||
{
|
||||
bool alreadyExists = false;
|
||||
for (PathSet::iterator j = paths2.begin(); j != paths2.end(); ++j) //search in p2 for duplicates
|
||||
{
|
||||
if(*i == *j){
|
||||
alreadyExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( !alreadyExists ){ //insert into p2 if not duplicate
|
||||
merged.insert(*i);
|
||||
}
|
||||
}
|
||||
|
||||
return merged;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue