1
1
Fork 0
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:
Wouter den Breejen 2007-06-13 15:18:57 +00:00
parent bc0af4449a
commit 184443d18d
7 changed files with 144 additions and 43 deletions

View file

@ -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;
}
}