diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-08-03 18:26:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-03 18:26:01 +0200 |
commit | 075bf6e5565aff9fba0ea02f3333c82adf4dccee (patch) | |
tree | 1ce61fe78b6b2c4498592281a1a2488b043e7e5c /src/libexpr | |
parent | 7d1ccd9105e418ac6948685244b3b4e0cb0cd368 (diff) | |
parent | ccbd906c86cb10e5c7b49753e057fec4ab46233c (diff) |
Merge pull request #6861 from edolstra/fix-count-calls
Fix NIX_COUNT_CALLS=1
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/eval.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index f485e2fed..e3716f217 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -2501,18 +2501,18 @@ void EvalState::printStats() } { auto list = topObj.list("functions"); - for (auto & i : functionCalls) { + for (auto & [fun, count] : functionCalls) { auto obj = list.object(); - if (i.first->name) - obj.attr("name", (const std::string &) i.first->name); + if (fun->name) + obj.attr("name", (std::string_view) symbols[fun->name]); else obj.attr("name", nullptr); - if (auto pos = positions[i.first->pos]) { - obj.attr("file", (const std::string &) pos.file); + if (auto pos = positions[fun->pos]) { + obj.attr("file", (std::string_view) pos.file); obj.attr("line", pos.line); obj.attr("column", pos.column); } - obj.attr("count", i.second); + obj.attr("count", count); } } { |