From 24a3b4ea99a40cc251b68561469b9099419adfe9 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 1 Oct 2015 15:08:10 -0700 Subject: XFA: Remove tests for failures after new statements. Manual merge of commit 357d16f8453c2cf0c0afd00eec9e86d03d55fe69. Original code review: https://codereview.chromium.org/1090693002 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1379683006 . --- core/src/fpdfdoc/pdf_vt.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'core/src/fpdfdoc/pdf_vt.h') diff --git a/core/src/fpdfdoc/pdf_vt.h b/core/src/fpdfdoc/pdf_vt.h index a237ef225e..2cd673fbe5 100644 --- a/core/src/fpdfdoc/pdf_vt.h +++ b/core/src/fpdfdoc/pdf_vt.h @@ -223,18 +223,13 @@ class CLines { } int32_t Add(const CPVT_LineInfo& lineinfo) { if (m_nTotal >= GetSize()) { - if (CLine* pLine = new CLine) { - pLine->m_LineInfo = lineinfo; - m_Lines.Add(pLine); - return m_nTotal++; - } - return m_nTotal; - } else { - if (CLine* pLine = GetAt(m_nTotal)) { - pLine->m_LineInfo = lineinfo; - } - return m_nTotal++; + CLine* pLine = new CLine; + pLine->m_LineInfo = lineinfo; + m_Lines.Add(pLine); + } else if (CLine* pLine = GetAt(m_nTotal)) { + pLine->m_LineInfo = lineinfo; } + return m_nTotal++; } void Clear() { for (int32_t i = GetSize() - 1; i >= m_nTotal; i--) { -- cgit v1.2.3