1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 07:22:43 +01:00

Merge pull request #13926 from NaN-git/opt_boost-unordered

replace all occurences of std::unordered_* by equivalents from boost
This commit is contained in:
Jörg Thalheim 2025-09-12 11:46:42 +02:00 committed by GitHub
commit 377b60ee9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 130 additions and 119 deletions

View file

@ -258,7 +258,7 @@ public:
*/
std::string makeRelative(const CanonPath & path) const;
friend class std::hash<CanonPath>;
friend struct std::hash<CanonPath>;
};
std::ostream & operator<<(std::ostream & stream, const CanonPath & path);
@ -268,6 +268,8 @@ std::ostream & operator<<(std::ostream & stream, const CanonPath & path);
template<>
struct std::hash<nix::CanonPath>
{
using is_avalanching = std::true_type;
std::size_t operator()(const nix::CanonPath & s) const noexcept
{
return std::hash<std::string>{}(s.path);

View file

@ -4,10 +4,10 @@
#include "nix/util/file-system.hh"
#include "nix/util/finally.hh"
#include <boost/unordered/unordered_flat_set.hpp>
#include <chrono>
#include <cmath>
#include <regex>
#include <unordered_set>
#include <thread>
#include <dirent.h>
@ -76,7 +76,7 @@ static CgroupStats destroyCgroup(const std::filesystem::path & cgroup, bool retu
int round = 1;
std::unordered_set<pid_t> pidsShown;
boost::unordered_flat_set<pid_t> pidsShown;
while (true) {
auto pids = tokenizeString<std::vector<std::string>>(readFile(procsFile));

View file

@ -104,7 +104,7 @@ std::optional<struct stat> PosixSourceAccessor::cachedLstat(const CanonPath & pa
if (cache.size() >= 16384)
cache.clear();
cache.emplace(absPath, st);
cache.emplace(std::move(absPath), st);
return st;
}