From ec93972356a9030d50094a412a76f56fe7e1cf0c Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Thu, 27 Feb 2025 17:18:53 -0800 Subject: [PATCH] fixup unit tests --- genaisrc/myai.genai.mts | 3 ++- src/math/lp/lar_core_solver.h | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/genaisrc/myai.genai.mts b/genaisrc/myai.genai.mts index 65742e4b0..0dfb205c9 100644 --- a/genaisrc/myai.genai.mts +++ b/genaisrc/myai.genai.mts @@ -199,10 +199,11 @@ export async function invokeLLMOpt(code: string) { Please modify the original code in to ensure that it uses best practices for optimal code execution. + - do use for loops of the form for (auto const& x : container) { ... } instead of for (it = container.begin(); it != container.end(); ++it) { ... }. - do not use assert. Instead use SASSERT. - do not change function signatures. - do not use std::vector. - - do not add new comments. + - do not add new comments. - do not split functions into multiple functions.` }, { system: [], diff --git a/src/math/lp/lar_core_solver.h b/src/math/lp/lar_core_solver.h index bd06a17c0..8e727bce9 100644 --- a/src/math/lp/lar_core_solver.h +++ b/src/math/lp/lar_core_solver.h @@ -82,9 +82,8 @@ public: void backup_x() { m_backup_x = m_r_x; } void restore_x() { + m_r_x = m_backup_x; m_r_x.reserve(m_m()); - for (unsigned i = 0; i < std::min(m_m(), m_backup_x.size()); ++i) - m_r_x[i] = m_backup_x[i]; } vector const& r_x() const { return m_r_x; }