Commit 0181020a authored by EXT Arnaud Clère's avatar EXT Arnaud Clère
Browse files

Small simplification

parent 3cbdd0b2
......@@ -425,7 +425,7 @@ struct QBind<TResult, const QJsonArray> { static TResult bind(Val<TResult> dst,
static_assert(TResult::Mode==Write,"Cannot Read from TResult into const QJsonArray&");
auto s(dst.sequence());
for (auto&& item : src) {
s = s.bind(item);
s.bind(item);
}
return s;
}};
......@@ -434,17 +434,15 @@ struct QBind<TResult, QJsonArray> {
static TResult bind(Val<TResult> dst, QJsonArray& src, std::enable_if_t<TResult::Mode==Write>* = nullptr) {
auto s(dst.sequence());
for (auto item : src) {
s = s.bind(item);
s.bind(item);
}
return s;
}
static TResult bind(Val<TResult> src, QJsonArray& dst, std::enable_if_t<TResult::Mode==Read >* = nullptr) {
auto s(src.sequence());
for (auto i = s.item(); i; i = s.item()) {
QJsonValue v;
s = i.bind(v);
if (s)
dst.push_back(v);
QJsonValue v;
while (s.bind(v)) {
dst.push_back(v);
}
return s;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment