From 6620be7ce8fe134bc3cdca9cd2bfad2f1688e6a2 Mon Sep 17 00:00:00 2001 From: David L Parkhurst Date: Fri, 1 Mar 2013 00:44:56 +0000 Subject: [PATCH] EndRow had extra loop on rows that was not needed. For many rows (400,000), it was unworkable before this fix. git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@7503 1feff8c3-07ed-0310-ac33-dd36852eb9cd --- src/SelectedOutput.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/SelectedOutput.cpp b/src/SelectedOutput.cpp index d2be3f48..0da49140 100644 --- a/src/SelectedOutput.cpp +++ b/src/SelectedOutput.cpp @@ -99,21 +99,18 @@ int CSelectedOutput::EndRow(void) // make sure array is full for (size_t col = 0; col < ncols; ++col) { - for (size_t row = 0; row < this->m_nRowCount; ++row) + size_t nrows = this->m_arrayVar[col].size(); + if (nrows < this->m_nRowCount) { - size_t nrows = this->m_arrayVar[col].size(); - if (nrows < this->m_nRowCount) - { - // fill w/ empty - this->m_arrayVar[col].resize(this->m_nRowCount); - } -#if defined(_DEBUG) - else if (nrows > this->m_nRowCount) - { - ASSERT(false); - } -#endif + // fill w/ empty + this->m_arrayVar[col].resize(this->m_nRowCount); } +#if defined(_DEBUG) + else if (nrows > this->m_nRowCount) + { + ASSERT(false); + } +#endif } } return 0;