ProjectLoader: replace access to listific with iterator; minor fixes
This commit is contained in:
1 parent
3fd8b9e674
commit
38203d1653
2 files changed
+10
-8
No files matched your search
+9
-3
@@ -1,4 +1,10 @@
|
||||
#include <concepts>
|
||||
#include <list>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
|
||||
#include "projectloader.h"
|
||||
|
||||
@@ -299,9 +305,9 @@ template <detail::Listific T>
|
||||
std::expected<QJsonArray, QString> save(const T &val) {
|
||||
QJsonArray arr;
|
||||
|
||||
for (size_t i = 0; i < val.size(); i++) {
|
||||
const auto &el = val[i];
|
||||
auto json = save<typename T::value_type>(el);
|
||||
size_t i = 0;
|
||||
for (auto it = std::cbegin(val); it != std::cend(val); it++, i++) {
|
||||
auto json = save<typename T::value_type>(*it);
|
||||
if (json) {
|
||||
arr.push_back(json.value());
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user