Skip to content

Commit d8fc55a

Browse files
committed
libexpr: Use table.size() instead of unnecessary loop
1 parent a80a5c4 commit d8fc55a

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

src/libexpr/primops/fromTOML.cc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,7 @@ static void prim_fromTOML(EvalState & state, const PosIdx pos, Value ** args, Va
1717
switch (t.type()) {
1818
case toml::value_t::table: {
1919
auto table = toml::get<toml::table>(t);
20-
21-
size_t size = 0;
22-
for (auto & i : table) {
23-
(void) i;
24-
size++;
25-
}
26-
27-
auto attrs = state.buildBindings(size);
20+
auto attrs = state.buildBindings(table.size());
2821

2922
for (auto & elem : table) {
3023
forceNoNullByte(elem.first);

0 commit comments

Comments
 (0)