From f81fec8a22cda68e2cff10c7704189bac3359f46 Mon Sep 17 00:00:00 2001 From: Wenbing Li <10278425+wenbingl@users.noreply.github.com> Date: Fri, 25 Aug 2023 08:33:51 -0700 Subject: [PATCH] Update pyfunc.cc for the prefast warning. (#545) * Update pyfunc.cc for the prefast warning. * address a comment --- pyop/pyfunc.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyop/pyfunc.cc b/pyop/pyfunc.cc index 5db122f4..28744b81 100644 --- a/pyop/pyfunc.cc +++ b/pyop/pyfunc.cc @@ -399,9 +399,9 @@ void PyCustomOpDef::AddOp(const PyCustomOpDef* cod) { // No need to protect against concurrent access, GIL is doing that. auto val = std::make_pair(op_domain, std::vector()); - const auto [it_domain_op, success] = PyOp_container().insert(val); + auto [it_domain_op, success] = PyOp_container().insert(val); assert(success || !it_domain_op->second.empty()); - it_domain_op->second.emplace_back(PyCustomOpFactory(cod, op_domain, op)); + it_domain_op->second.emplace_back(cod, op_domain, op); } const PyCustomOpFactory* PyCustomOpDef_FetchPyCustomOps(size_t num) {