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/contact.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/contact.cpp') diff --git a/src/contact.cpp b/src/contact.cpp index 0050f95..01aa710 100644 --- a/src/contact.cpp +++ b/src/contact.cpp @@ -111,19 +111,9 @@ ContactData ContactData::load(const Ref & ref) if (!rec) return ContactData(); - vector> prev; - for (const auto & x : rec->items("PREV")) - if (const auto & p = x.as()) - prev.push_back(*p); - - vector>> identity; - for (const auto & x : rec->items("identity")) - if (const auto & i = x.asRef()) - identity.push_back(*i); - return ContactData { - .prev = std::move(prev), - .identity = std::move(identity), + .prev = rec->items("PREV").as(), + .identity = rec->items("identity").as>(), .name = rec->item("name").asText(), }; } -- cgit v1.2.3