Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rewrite as for loop
  • Loading branch information
KiChjang committed Jul 8, 2021
commit 8d30b525643d52b5df393d70326fc81fe5c82fd7
14 changes: 5 additions & 9 deletions frame/identity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,15 +419,11 @@ pub mod pallet {
for s in old_ids.iter() {
<SuperOf<T>>::remove(s);
}
let ids: BoundedVec<_, _> = subs
.into_iter()
.map(|(id, name)| {
<SuperOf<T>>::insert(&id, (sender.clone(), name));
id
})
.collect::<Vec<_>>()
.try_into()
.expect("subs is less than T::MaxSubAccounts; qed");
let mut ids = BoundedVec::<T::AccountId, T::MaxSubAccounts>::default();
for (id, name) in subs {
<SuperOf<T>>::insert(&id, (sender.clone(), name));
ids.try_push(id).expect("subs length is less than T::MaxSubAccounts; qed");
}
let new_subs = ids.len();

if ids.is_empty() {
Expand Down