Skip to content

Commit

Permalink
remove memory alloc from statistics_report
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoplopes committed Dec 5, 2022
1 parent eb8c53c commit a2f5a5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/tactic/core/elim_uncnstr_tactic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,8 +867,7 @@ class elim_uncnstr_tactic : public tactic {
void run(goal_ref const & g, goal_ref_buffer & result) {
bool produce_proofs = g->proofs_enabled();
TRACE("goal", g->display(tout););
std::function<void(statistics&)> coll = [&](statistics& st) { collect_statistics(st); };
statistics_report sreport(coll);
statistics_report sreport([&](statistics& st) { collect_statistics(st); });
tactic_report report("elim-uncnstr", *g);
m_vars.reset();
collect_occs p;
Expand Down
2 changes: 1 addition & 1 deletion src/tactic/tactic.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class statistics_report {
std::function<void(statistics& st)> m_collector;
public:
statistics_report(tactic& t):m_tactic(&t) {}
statistics_report(std::function<void(statistics&)>& coll): m_collector(coll) {}
statistics_report(std::function<void(statistics&)>&& coll): m_collector(std::move(coll)) {}
~statistics_report();
};

Expand Down

0 comments on commit a2f5a5b

Please sign in to comment.