1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-30 06:01:00 +01:00

Merge remote-tracking branch 'origin/master' into lazy-trees

This commit is contained in:
Eelco Dolstra 2022-12-12 17:53:06 +01:00
commit 12c554acd4
19 changed files with 90 additions and 82 deletions

View file

@ -515,8 +515,9 @@ template<typename T>
T readLittleEndian(unsigned char * p)
{
T x = 0;
for (size_t i = 0; i < sizeof(x); ++i)
x |= ((T) *p++) << (i * 8);
for (size_t i = 0; i < sizeof(x); ++i, ++p) {
x |= ((T) *p) << (i * 8);
}
return x;
}
@ -756,7 +757,9 @@ inline std::string operator + (std::string && s, std::string_view s2)
inline std::string operator + (std::string_view s1, const char * s2)
{
std::string s(s1);
std::string s;
s.reserve(s1.size() + strlen(s2));
s.append(s1);
s.append(s2);
return s;
}