From 53e271563881df7720e2204adecb4f0c21337190 Mon Sep 17 00:00:00 2001 From: Tony Butler Date: Sun, 24 Oct 2021 03:48:23 -0600 Subject: [PATCH] Fix for crash when sending config via API --- src/core/MoBenchmark.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/MoBenchmark.cpp b/src/core/MoBenchmark.cpp index 32025d65..66b6e862 100644 --- a/src/core/MoBenchmark.cpp +++ b/src/core/MoBenchmark.cpp @@ -76,7 +76,7 @@ rapidjson::Value MoBenchmark::toJSON(rapidjson::Document &doc) const Value obj(kObjectType); - for (const auto &a : m_controller->miner()->algorithms()) { + for (const Algorithm a : Algorithm::all()) { if (algo_perf[a.id()] == 0.0f) continue; obj.AddMember(StringRef(a.name()), algo_perf[a.id()], allocator); } @@ -86,7 +86,7 @@ rapidjson::Value MoBenchmark::toJSON(rapidjson::Document &doc) const void MoBenchmark::read(const rapidjson::Value &value) { - for (const Algorithm::Id algo : Algorithm::all([this](const Algorithm&) { return true; })) { + for (const Algorithm::Id algo : Algorithm::all()) { algo_perf[algo] = 0.0f; } if (value.IsObject()) {