summaryrefslogtreecommitdiff
path: root/src/set.cpp
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2023-06-17 21:58:32 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2023-06-18 22:41:23 +0200
commite7d6aafd3c9353d9e6169ca775cf1dae618238cd (patch)
tree6df8f296d7db8dd9e7d23f5774009ccc5ee269a7 /src/set.cpp
parent2130d07cbf91e016fd21a730a8449dd4bd34a093 (diff)
Storage: iterable type for record item list
Diffstat (limited to 'src/set.cpp')
-rw-r--r--src/set.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/set.cpp b/src/set.cpp
index d224af3..ce343d8 100644
--- a/src/set.cpp
+++ b/src/set.cpp
@@ -153,19 +153,9 @@ vector<Ref> SetBase::store() const
SetItem SetItem::load(const Ref & ref)
{
if (auto rec = ref->asRecord()) {
- vector<Stored<SetItem>> prev;
- for (auto p : rec->items("PREV"))
- if (const auto & x = p.as<SetItem>())
- prev.push_back(*x);
-
- vector<Ref> item;
- for (auto i : rec->items("item"))
- if (const auto & x = i.asRef())
- item.push_back(*x);
-
return SetItem {
- .prev = std::move(prev),
- .item = std::move(item),
+ .prev = rec->items("PREV").as<SetItem>(),
+ .item = rec->items("item").asRef(),
};
}