From be4e055bce62c9af26461f435704b9aa086f6fc4 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 5 Oct 2018 19:17:23 +0000 Subject: Remove unreachable null checks in CPDF_ActionFields We always pass &local as the argument to the ctor. Change-Id: I3d6e046b8aed0a2cee3c3c20513e72b85741cabe Reviewed-on: https://pdfium-review.googlesource.com/c/43550 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- core/fpdfdoc/cpdf_actionfields.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/core/fpdfdoc/cpdf_actionfields.cpp b/core/fpdfdoc/cpdf_actionfields.cpp index 2af70c2be5..4db5bc543b 100644 --- a/core/fpdfdoc/cpdf_actionfields.cpp +++ b/core/fpdfdoc/cpdf_actionfields.cpp @@ -11,15 +11,14 @@ #include "core/fpdfdoc/cpdf_action.h" CPDF_ActionFields::CPDF_ActionFields(const CPDF_Action* pAction) - : m_pAction(pAction) {} + : m_pAction(pAction) { + ASSERT(m_pAction); +} CPDF_ActionFields::~CPDF_ActionFields() = default; std::vector CPDF_ActionFields::GetAllFields() const { std::vector fields; - if (!m_pAction) - return fields; - const CPDF_Dictionary* pDict = m_pAction->GetDict(); if (!pDict) return fields; @@ -47,9 +46,6 @@ std::vector CPDF_ActionFields::GetAllFields() const { } const CPDF_Object* CPDF_ActionFields::GetField(size_t iIndex) const { - if (!m_pAction) - return nullptr; - const CPDF_Dictionary* pDict = m_pAction->GetDict(); if (!pDict) return nullptr; -- cgit v1.2.3