summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-08-23 14:05:13 +0300
committerDennis Francis <dennis.francis@collabora.co.uk>2017-11-21 13:49:49 +0530
commit4cc406e477be7e06efa356611b900016c809d1b4 (patch)
treef28fdba26087b458a165f28d2b0a56537fa3127b
parent115206ed8a797ed82de63fa33d82bb3679d01d63 (diff)
Bin some YAGNI code
We don't do anything at the moment to check whether a formula group calculation thread "failed", I don't even know what it actually would mean. So just bin that code for now. Change-Id: Ie4b15a3c20169d08d338e255a71a139913528a16
-rw-r--r--sc/source/core/data/formulacell.cxx25
1 files changed, 4 insertions, 21 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index d6996fa35036..ede2b15616fc 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -4254,7 +4254,6 @@ bool ScFormulaCell::InterpretFormulaGroup()
// Then do the threaded calculation
- bool result = true;
class Executor : public comphelper::ThreadTask
{
private:
@@ -4263,7 +4262,6 @@ bool ScFormulaCell::InterpretFormulaGroup()
ScDocument* mpDocument;
const ScAddress& mrTopPos;
SCROW mnLength;
- std::vector<int>& mrResult;
public:
Executor(std::shared_ptr<comphelper::ThreadTaskTag>& rTag,
@@ -4271,24 +4269,19 @@ bool ScFormulaCell::InterpretFormulaGroup()
unsigned nThreadsTotal,
ScDocument* pDocument2,
const ScAddress& rTopPos,
- SCROW nLength,
- std::vector<int>& rResult) :
+ SCROW nLength) :
comphelper::ThreadTask(rTag),
mnThisThread(nThisThread),
mnThreadsTotal(nThreadsTotal),
mpDocument(pDocument2),
mrTopPos(rTopPos),
- mnLength(nLength),
- mrResult(rResult)
+ mnLength(nLength)
{
}
virtual void doWork() override
{
mpDocument->CalculateInColumnInThread(mrTopPos, mnLength, mnThisThread, mnThreadsTotal);
- // FIXME: How to determine whether it "worked" or not? Does it even have a meaning? Just
- // drop this as YAGNI?
- mrResult[mnThisThread] = static_cast<int>(true);
}
};
@@ -4302,30 +4295,20 @@ bool ScFormulaCell::InterpretFormulaGroup()
ScMutationGuard aGuard(pDocument, ScMutationGuardFlags::CORE);
// Start nThreadCount new threads
- std::vector<int> vResult(nThreadCount);
std::shared_ptr<comphelper::ThreadTaskTag> aTag = comphelper::ThreadPool::createThreadTaskTag();
for (int i = 0; i < nThreadCount; ++i)
{
- rThreadPool.pushTask(new Executor(aTag, i, nThreadCount, pDocument, mxGroup->mpTopCell->aPos, mxGroup->mnLength, vResult));
+ rThreadPool.pushTask(new Executor(aTag, i, nThreadCount, pDocument, mxGroup->mpTopCell->aPos, mxGroup->mnLength));
}
SAL_INFO("sc.threaded", "Joining threads");
rThreadPool.waitUntilDone(aTag);
SAL_INFO("sc.threaded", "Done");
-
- for (int i = 0; i < nThreadCount; ++i)
- {
- if (!vResult[i])
- {
- SAL_INFO("sc.threaded", "Thread " << i << " failed");
- result = false;
- }
- }
}
pDocument->HandleStuffAfterParallelCalculation(mxGroup->mpTopCell->aPos, mxGroup->mnLength);
- return result;
+ return true;
}
switch (pCode->GetVectorState())