From e7d6aafd3c9353d9e6169ca775cf1dae618238cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 17 Jun 2023 21:58:32 +0200 Subject: Storage: iterable type for record item list --- src/set.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/set.cpp') 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 SetBase::store() const SetItem SetItem::load(const Ref & ref) { if (auto rec = ref->asRecord()) { - vector> prev; - for (auto p : rec->items("PREV")) - if (const auto & x = p.as()) - prev.push_back(*x); - - vector 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(), + .item = rec->items("item").asRef(), }; } -- cgit v1.2.3