From 388a3b0b8d6f75d47978c08299300f121f04884c Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 13 Aug 2015 15:24:19 -0700 Subject: Remove if checks after new. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1287863002 . --- fpdfsdk/src/javascript/app.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'fpdfsdk/src/javascript') diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp index 24f00ca262..1b84508fd6 100644 --- a/fpdfsdk/src/javascript/app.cpp +++ b/fpdfsdk/src/javascript/app.cpp @@ -298,19 +298,12 @@ FX_BOOL app::alert(IFXJS_Context* cc, if (swMsg == L"") { CJS_Array carray(isolate); if (params[0].ConvertToArray(carray)) { - int iLenth = carray.GetLength(); + int iLength = carray.GetLength(); CJS_Value* pValue = new CJS_Value(isolate); - // if (iLenth == 1) - // pValue = new - // CJS_Value(isolate); - // else if (iLenth > 1) - // pValue = new - // CJS_Value[iLenth]; - - for (int i = 0; i < iLenth; i++) { + for (int i = 0; i < iLength; ++i) { carray.GetElement(i, *pValue); swMsg += (*pValue).ToCFXWideString(); - if (i < iLenth - 1) + if (i < iLength - 1) swMsg += L", "; } -- cgit v1.2.3