1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

libexpr: Use table.size() instead of unnecessary loop

(cherry picked from commit d8fc55a46e)
This commit is contained in:
Sergei Zimmerman 2025-08-12 14:58:01 +03:00
parent 027bf13e18
commit b4871a4a94
No known key found for this signature in database

View file

@ -17,14 +17,7 @@ static void prim_fromTOML(EvalState & state, const PosIdx pos, Value ** args, Va
switch (t.type()) {
case toml::value_t::table: {
auto table = toml::get<toml::table>(t);
size_t size = 0;
for (auto & i : table) {
(void) i;
size++;
}
auto attrs = state.buildBindings(size);
auto attrs = state.buildBindings(table.size());
for (auto & elem : table) {
forceNoNullByte(elem.first);