summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/xfa_program.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-28 16:56:08 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-28 16:56:08 -0700
commita31098417852bdf13e693a6e0913e0706cf94098 (patch)
tree7539d764cfc859d8d88ab0162281f2184d1963b7 /xfa/fxfa/fm2js/xfa_program.cpp
parent9a1b665f8a6762927b7fa4fb9c812f00e8d3135e (diff)
downloadpdfium-a31098417852bdf13e693a6e0913e0706cf94098.tar.xz
Convert CFX_PtrArray to typesafe CFX_ArrayTemplate, Part 6
Review-Url: https://codereview.chromium.org/1926303002
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_program.cpp')
-rw-r--r--xfa/fxfa/fm2js/xfa_program.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/xfa/fxfa/fm2js/xfa_program.cpp b/xfa/fxfa/fm2js/xfa_program.cpp
index ef5efb214c..a5c429765f 100644
--- a/xfa/fxfa/fm2js/xfa_program.cpp
+++ b/xfa/fxfa/fm2js/xfa_program.cpp
@@ -17,20 +17,16 @@ int32_t CXFA_FMProgram::Init(const CFX_WideStringC& wsFormcalc) {
return m_parse.Init(wsFormcalc, &m_pErrorInfo);
}
int32_t CXFA_FMProgram::ParseProgram() {
- CFX_PtrArray* expressions = 0;
+ CFX_ArrayTemplate<CXFA_FMExpression*>* expressions = nullptr;
m_parse.NextToken();
if (!m_pErrorInfo.message.IsEmpty()) {
return -1;
}
expressions = m_parse.ParseTopExpression();
if (!m_pErrorInfo.message.IsEmpty()) {
- CXFA_FMExpression* e = 0;
- for (int32_t u = 0; u < expressions->GetSize(); ++u) {
- e = (CXFA_FMExpression*)expressions->GetAt(u);
- if (e) {
- delete e;
- }
- }
+ for (int32_t u = 0; u < expressions->GetSize(); ++u)
+ delete expressions->GetAt(u);
+
delete expressions;
return -1;
}