summaryrefslogtreecommitdiff
path: root/src/channel.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/channel.cpp
parent2130d07cbf91e016fd21a730a8449dd4bd34a093 (diff)
Storage: iterable type for record item list
Diffstat (limited to 'src/channel.cpp')
-rw-r--r--src/channel.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/channel.cpp b/src/channel.cpp
index 08db911..b317f3d 100644
--- a/src/channel.cpp
+++ b/src/channel.cpp
@@ -26,15 +26,10 @@ Ref ChannelRequestData::store(const Storage & st) const
ChannelRequestData ChannelRequestData::load(const Ref & ref)
{
if (auto rec = ref->asRecord()) {
- remove_const<decltype(peers)>::type peers;
- for (const auto & i : rec->items("peer"))
- if (auto p = i.as<Signed<IdentityData>>())
- peers.push_back(*p);
-
if (rec->item("enc").asText() == "aes-128-gcm")
if (auto key = rec->item("key").as<PublicKexKey>())
return ChannelRequestData {
- .peers = std::move(peers),
+ .peers = rec->items("peer").as<Signed<IdentityData>>(),
.key = *key,
};
}