1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 10:50:24 -04:00

dropEmptyInitThenConcatStringsSep: Allow it to drop items again

It's usually harmless, if it occurs at all.
This commit is contained in:
Robert Hensing 2024-07-13 02:16:13 +02:00
parent 6b2c277c36
commit 1c97718146

View file

@ -41,11 +41,13 @@ std::string dropEmptyInitThenConcatStringsSep(const std::string_view sep, const
{ {
size_t size = 0; size_t size = 0;
for (auto & i : ss) { // TODO? remove to make sure we don't rely on the empty item ignoring behavior,
// Make sure we don't rely on the empty item ignoring behavior // or just get rid of this function by understanding the remaining calls.
assert(!i.empty()); // for (auto & i : ss) {
break; // // Make sure we don't rely on the empty item ignoring behavior
} // assert(!i.empty());
// break;
// }
// need a cast to string_view since this is also called with Symbols // need a cast to string_view since this is also called with Symbols
for (const auto & s : ss) size += sep.size() + std::string_view(s).size(); for (const auto & s : ss) size += sep.size() + std::string_view(s).size();