Skip to content

Commit 245e68b

Browse files
committed
fix: replace HashSet with BTreeSet
1 parent b1cc5ad commit 245e68b

File tree

1 file changed

+3
-3
lines changed
  • pallets/pallet-bonded-coins/src

1 file changed

+3
-3
lines changed

pallets/pallet-bonded-coins/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ pub mod pallet {
7070
Hashable, Parameter,
7171
};
7272
use frame_system::pallet_prelude::*;
73-
use parity_scale_codec::alloc::collections::HashSet;
7473
use sp_arithmetic::ArithmeticError;
7574
use sp_core::U256;
7675
use sp_runtime::{
@@ -80,6 +79,7 @@ pub mod pallet {
8079
BoundedVec, DispatchError, TokenError,
8180
};
8281
use sp_std::{
82+
collections::btree_set::BTreeSet,
8383
iter::Iterator,
8484
ops::{AddAssign, BitOrAssign, ShlAssign},
8585
prelude::*,
@@ -408,8 +408,8 @@ pub mod pallet {
408408
// currency to it. This should also verify that the currency actually exists.
409409
T::Collaterals::touch(collateral_id.clone(), pool_account, &who)?;
410410

411-
let mut names_seen = HashSet::<StringInputOf<T>>::with_capacity(currencies.len());
412-
let mut symbols_seen = HashSet::<StringInputOf<T>>::with_capacity(currencies.len());
411+
let mut names_seen = BTreeSet::<StringInputOf<T>>::new();
412+
let mut symbols_seen = BTreeSet::<StringInputOf<T>>::new();
413413

414414
currencies.into_iter().zip(currency_ids.iter()).try_for_each(
415415
|(token_metadata, asset_id)| -> DispatchResult {

0 commit comments

Comments
 (0)