Remove std::set alias

This commit is contained in:
Eelco Dolstra 2022-02-21 16:28:23 +01:00
parent afcdc7606c
commit fe9afb65bb
11 changed files with 15 additions and 16 deletions

View file

@ -266,7 +266,7 @@ void DrvInfo::setMeta(const string & name, Value * v)
/* Cache for already considered attrsets. */ /* Cache for already considered attrsets. */
typedef set<Bindings *> Done; typedef std::set<Bindings *> Done;
/* Evaluate value `v'. If it evaluates to a set of type `derivation', /* Evaluate value `v'. If it evaluates to a set of type `derivation',

View file

@ -654,7 +654,7 @@ static void prim_genericClosure(EvalState & state, const Pos & pos, Value * * ar
// `doneKeys' doesn't need to be a GC root, because its values are // `doneKeys' doesn't need to be a GC root, because its values are
// reachable from res. // reachable from res.
auto cmp = CompareValues(state); auto cmp = CompareValues(state);
set<Value *, decltype(cmp)> doneKeys(cmp); std::set<Value *, decltype(cmp)> doneKeys(cmp);
while (!workSet.empty()) { while (!workSet.empty()) {
Value * e = *(workSet.begin()); Value * e = *(workSet.begin());
workSet.pop_front(); workSet.pop_front();

View file

@ -1091,7 +1091,7 @@ HookReply DerivationGoal::tryBuildHook()
/* Create the log file and pipe. */ /* Create the log file and pipe. */
Path logFile = openLogFile(); Path logFile = openLogFile();
set<int> fds; std::set<int> fds;
fds.insert(hook->fromHook.readSide.get()); fds.insert(hook->fromHook.readSide.get());
fds.insert(hook->builderOut.readSide.get()); fds.insert(hook->builderOut.readSide.get());
worker.childStarted(shared_from_this(), fds, false, false); worker.childStarted(shared_from_this(), fds, false, false);

View file

@ -18,8 +18,8 @@ struct CompareGoalPtrs {
}; };
/* Set of goals. */ /* Set of goals. */
typedef set<GoalPtr, CompareGoalPtrs> Goals; typedef std::set<GoalPtr, CompareGoalPtrs> Goals;
typedef set<WeakGoalPtr, std::owner_less<WeakGoalPtr>> WeakGoals; typedef std::set<WeakGoalPtr, std::owner_less<WeakGoalPtr>> WeakGoals;
/* A map of paths to goals (and the other way around). */ /* A map of paths to goals (and the other way around). */
typedef std::map<StorePath, WeakGoalPtr> WeakGoalMap; typedef std::map<StorePath, WeakGoalPtr> WeakGoalMap;

View file

@ -161,7 +161,7 @@ unsigned Worker::getNrLocalBuilds()
} }
void Worker::childStarted(GoalPtr goal, const set<int> & fds, void Worker::childStarted(GoalPtr goal, const std::set<int> & fds,
bool inBuildSlot, bool respectTimeouts) bool inBuildSlot, bool respectTimeouts)
{ {
Child child; Child child;
@ -377,7 +377,7 @@ void Worker::waitForInput()
GoalPtr goal = j->goal.lock(); GoalPtr goal = j->goal.lock();
assert(goal); assert(goal);
set<int> fds2(j->fds); std::set<int> fds2(j->fds);
std::vector<unsigned char> buffer(4096); std::vector<unsigned char> buffer(4096);
for (auto & k : fds2) { for (auto & k : fds2) {
if (pollStatus.at(fdToPollStatus.at(k)).revents) { if (pollStatus.at(fdToPollStatus.at(k)).revents) {

View file

@ -38,7 +38,7 @@ struct Child
{ {
WeakGoalPtr goal; WeakGoalPtr goal;
Goal * goal2; // ugly hackery Goal * goal2; // ugly hackery
set<int> fds; std::set<int> fds;
bool respectTimeouts; bool respectTimeouts;
bool inBuildSlot; bool inBuildSlot;
steady_time_point lastOutput; /* time we last got output on stdout/stderr */ steady_time_point lastOutput; /* time we last got output on stdout/stderr */
@ -167,7 +167,7 @@ public:
/* Registers a running child process. `inBuildSlot' means that /* Registers a running child process. `inBuildSlot' means that
the process counts towards the jobs limit. */ the process counts towards the jobs limit. */
void childStarted(GoalPtr goal, const set<int> & fds, void childStarted(GoalPtr goal, const std::set<int> & fds,
bool inBuildSlot, bool respectTimeouts); bool inBuildSlot, bool respectTimeouts);
/* Unregisters a running child process. `wakeSleepers' should be /* Unregisters a running child process. `wakeSleepers' should be

View file

@ -292,7 +292,7 @@ private:
typedef std::pair<dev_t, ino_t> Inode; typedef std::pair<dev_t, ino_t> Inode;
typedef set<Inode> InodesSeen; typedef std::set<Inode> InodesSeen;
/* "Fix", or canonicalise, the meta-data of the files in a store path /* "Fix", or canonicalise, the meta-data of the files in a store path

View file

@ -11,12 +11,11 @@
namespace nix { namespace nix {
using std::set;
using std::vector; using std::vector;
using std::string; using std::string;
typedef std::list<string> Strings; typedef std::list<string> Strings;
typedef set<string> StringSet; typedef std::set<string> StringSet;
typedef std::map<string, string> StringMap; typedef std::map<string, string> StringMap;
/* Paths are just strings. */ /* Paths are just strings. */
@ -24,7 +23,7 @@ typedef std::map<string, string> StringMap;
typedef string Path; typedef string Path;
typedef std::string_view PathView; typedef std::string_view PathView;
typedef std::list<Path> Paths; typedef std::list<Path> Paths;
typedef set<Path> PathSet; typedef std::set<Path> PathSet;
typedef vector<std::pair<string, string>> Headers; typedef vector<std::pair<string, string>> Headers;

View file

@ -1174,7 +1174,7 @@ void runProgram2(const RunOptions & options)
} }
void closeMostFDs(const set<int> & exceptions) void closeMostFDs(const std::set<int> & exceptions)
{ {
#if __linux__ #if __linux__
try { try {

View file

@ -343,7 +343,7 @@ std::vector<char *> stringsToCharPtrs(const Strings & ss);
/* Close all file descriptors except those listed in the given set. /* Close all file descriptors except those listed in the given set.
Good practice in child processes. */ Good practice in child processes. */
void closeMostFDs(const set<int> & exceptions); void closeMostFDs(const std::set<int> & exceptions);
/* Set the close-on-exec flag for the given file descriptor. */ /* Set the close-on-exec flag for the given file descriptor. */
void closeOnExec(int fd); void closeOnExec(int fd);

View file

@ -75,7 +75,7 @@ struct NixRepl
Expr * parseString(string s); Expr * parseString(string s);
void evalString(string s, Value & v); void evalString(string s, Value & v);
typedef set<Value *> ValuesSeen; typedef std::set<Value *> ValuesSeen;
std::ostream & printValue(std::ostream & str, Value & v, unsigned int maxDepth); std::ostream & printValue(std::ostream & str, Value & v, unsigned int maxDepth);
std::ostream & printValue(std::ostream & str, Value & v, unsigned int maxDepth, ValuesSeen & seen); std::ostream & printValue(std::ostream & str, Value & v, unsigned int maxDepth, ValuesSeen & seen);
}; };