From a8a40d902e6f743620820d6e4c26fd728be98ce0 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Mon, 30 Dec 2024 19:35:14 +0000 Subject: [PATCH] Remove dead code. NFC --- lib/Differentiator/ReverseModeVisitor.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/Differentiator/ReverseModeVisitor.cpp b/lib/Differentiator/ReverseModeVisitor.cpp index 5a935fb78..7d01ec589 100644 --- a/lib/Differentiator/ReverseModeVisitor.cpp +++ b/lib/Differentiator/ReverseModeVisitor.cpp @@ -204,13 +204,8 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, assert(m_DiffReq.Function && "Must not be null."); DiffParams args{}; - if (m_DiffReq.Args) - for (const auto& dParam : m_DiffReq.DVI) - args.push_back(dParam.param); - else - std::copy(FD->param_begin(), FD->param_end(), std::back_inserter(args)); - if (args.empty()) - return {}; + for (const auto& dParam : m_DiffReq.DVI) + args.push_back(dParam.param); if (m_ExternalSource) m_ExternalSource->ActAfterParsingDiffArgs(m_DiffReq, args); @@ -359,11 +354,8 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, assert(m_DiffReq.Function && "Must not be null."); DiffParams args{}; - if (!m_DiffReq.DVI.empty()) - for (const auto& dParam : m_DiffReq.DVI) - args.push_back(dParam.param); - else - std::copy(FD->param_begin(), FD->param_end(), std::back_inserter(args)); + for (const auto& dParam : m_DiffReq.DVI) + args.push_back(dParam.param); #ifndef NDEBUG bool isStaticMethod = utils::IsStaticMethod(FD); assert((!args.empty() || !isStaticMethod) &&