1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-05 20:41:47 +02:00

Improve boost hacks

This commit is contained in:
John Ericson 2024-06-27 17:28:31 -04:00
parent 8399bd6b8f
commit 0b539dea4a
11 changed files with 26 additions and 131 deletions

View file

@ -1,7 +1,6 @@
#include "network-proxy.hh"
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include "environment-variables.hh"
@ -13,7 +12,9 @@ static StringSet getAllVariables()
{
StringSet variables = lowercaseVariables;
for (const auto & variable : lowercaseVariables) {
variables.insert(boost::to_upper_copy(variable));
std::string upperVariable;
std::transform(variable.begin(), variable.end(), upperVariable.begin(), [](unsigned char c) { return std::toupper(c); });
variables.insert(std::move(upperVariable));
}
return variables;
}