Skip to content

Commit d1b10e0

Browse files
committed
fix: correctly read subtaskdependence
1 parent 167d2a0 commit d1b10e0

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

makespec/BUILDVERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
183
1+
184

src/core/testcase.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,8 @@ int TestCase::readFromJson(const QJsonObject &in) {
139139
return -1;
140140
auto fileName = i.toString();
141141
if (fileName.endsWith("_lemon_SUbtaskDEPENDENCE_fLAg")) {
142-
int temp{0};
143-
for (auto c : fileName) {
144-
temp *= 10;
145-
temp += c.toLatin1() ^ '0';
146-
}
147-
dependenceSubtask.push_back(temp);
142+
fileName.remove("_lemon_SUbtaskDEPENDENCE_fLAg");
143+
dependenceSubtask.push_back(fileName.toInt());
148144
} else {
149145
fileName.replace('/', QDir::separator());
150146
this->inputFiles.push_back(fileName);
@@ -166,12 +162,8 @@ void TestCase::readFromStream(QDataStream &in) {
166162

167163
for (auto &i : _inputFiles) {
168164
if (i.endsWith("_lemon_SUbtaskDEPENDENCE_fLAg")) {
169-
int temp(0);
170-
171-
for (auto *itr = i.constBegin(); *itr != '_'; ++itr)
172-
(temp *= 10) += itr->toLatin1() ^ '0';
173-
174-
dependenceSubtask.push_back(temp);
165+
i.remove("_lemon_SUbtaskDEPENDENCE_fLAg");
166+
dependenceSubtask.push_back(i.toInt());
175167
} else {
176168
inputFiles.push_back(i);
177169
inputFiles.back().replace('/', QDir::separator());

0 commit comments

Comments
 (0)