diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-06-09 18:14:41 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-06-09 19:57:11 +0200 |
commit | 5897a97bb53bcbf2283161cc22f43d87f575f3d6 (patch) | |
tree | 75fa0ded29624a58a7e3b2b5c6b16ef65be88406 /sccomp | |
parent | 8ed68179e2eaf07289663c64d923d8b5dd8b25c9 (diff) |
Simplify Sequences initializations (sccomp)
Change-Id: I6316e1318ae1ee68e5d4e4529731bca0d1860b58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116932
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sccomp')
-rw-r--r-- | sccomp/qa/unit/SwarmSolverTest.cxx | 21 | ||||
-rw-r--r-- | sccomp/qa/unit/solver.cxx | 3 |
2 files changed, 8 insertions, 16 deletions
diff --git a/sccomp/qa/unit/SwarmSolverTest.cxx b/sccomp/qa/unit/SwarmSolverTest.cxx index b7d3becc475c..78cfccaaa376 100644 --- a/sccomp/qa/unit/SwarmSolverTest.cxx +++ b/sccomp/qa/unit/SwarmSolverTest.cxx @@ -75,8 +75,7 @@ void SwarmSolverTest::testUnconstrained() table::CellAddress aObjective(0, 1, 1); // "changing cells" - unknown variables - uno::Sequence<table::CellAddress> aVariables(1); - aVariables[0] = table::CellAddress(0, 1, 0); + uno::Sequence<table::CellAddress> aVariables{ { 0, 1, 0 } }; // constraints uno::Sequence<sheet::SolverConstraint> aConstraints; @@ -125,8 +124,7 @@ void SwarmSolverTest::testVariableBounded() table::CellAddress aObjective(0, 1, 1); // "changing cells" - unknown variables - uno::Sequence<table::CellAddress> aVariables(1); - aVariables[0] = table::CellAddress(0, 1, 0); + uno::Sequence<table::CellAddress> aVariables{ { 0, 1, 0 } }; // constraints uno::Sequence<sheet::SolverConstraint> aConstraints(2); @@ -177,8 +175,7 @@ void SwarmSolverTest::testVariableConstrained() table::CellAddress aObjective(0, 1, 1); // "changing cells" - unknown variables - uno::Sequence<table::CellAddress> aVariables(1); - aVariables[0] = table::CellAddress(0, 1, 0); + uno::Sequence<table::CellAddress> aVariables{ { 0, 1, 0 } }; // constraints uno::Sequence<sheet::SolverConstraint> aConstraints(3); @@ -233,9 +230,7 @@ void SwarmSolverTest::testTwoVariables() table::CellAddress aObjective(0, 1, 5); // "changing cells" - unknown variables - uno::Sequence<table::CellAddress> aVariables(2); - aVariables[0] = table::CellAddress(0, 1, 2); - aVariables[1] = table::CellAddress(0, 1, 3); + uno::Sequence<table::CellAddress> aVariables{ { 0, 1, 2 }, { 0, 1, 3 } }; // constraints uno::Sequence<sheet::SolverConstraint> aConstraints(4); @@ -299,11 +294,9 @@ void SwarmSolverTest::testMultipleVariables() table::CellAddress aObjective(0, 5, 7); // "changing cells" - unknown variables - uno::Sequence<table::CellAddress> aVariables(4); - aVariables[0] = table::CellAddress(0, 6, 1); - aVariables[1] = table::CellAddress(0, 6, 2); - aVariables[2] = table::CellAddress(0, 6, 3); - aVariables[3] = table::CellAddress(0, 6, 4); + uno::Sequence<table::CellAddress> aVariables{ + { 0, 6, 1 }, { 0, 6, 2 }, { 0, 6, 3 }, { 0, 6, 4 } + }; // constraints uno::Sequence<sheet::SolverConstraint> aConstraints(12); diff --git a/sccomp/qa/unit/solver.cxx b/sccomp/qa/unit/solver.cxx index 4405279e26cb..eedbce69f274 100644 --- a/sccomp/qa/unit/solver.cxx +++ b/sccomp/qa/unit/solver.cxx @@ -87,8 +87,7 @@ void LpSolverTest::testSolver(OUString const & rName) table::CellAddress aObjective(0, 0, 0); // "changing cells" - unknown variables - uno::Sequence<table::CellAddress> aVariables(1); - aVariables[0] = table::CellAddress(0, 0, 0); + uno::Sequence<table::CellAddress> aVariables { {0, 0, 0 } }; // constraints uno::Sequence<sheet::SolverConstraint> aConstraints(1); |