From a935274ef9dfb1c1d197d9d8d27030f3a65c603c Mon Sep 17 00:00:00 2001 From: Peter Goodspeed-Niklaus Date: Thu, 6 May 2021 13:01:42 +0200 Subject: [PATCH] BoundedVec MaxEncodedLen microoptimization (#8746) --- substrate/frame/support/src/storage/bounded_vec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/support/src/storage/bounded_vec.rs b/substrate/frame/support/src/storage/bounded_vec.rs index f441ba39b8..868be980e8 100644 --- a/substrate/frame/support/src/storage/bounded_vec.rs +++ b/substrate/frame/support/src/storage/bounded_vec.rs @@ -357,7 +357,7 @@ where // BoundedVec encodes like Vec which encodes like [T], which is a compact u32 // plus each item in the slice: // https://substrate.dev/rustdocs/v3.0.0/src/parity_scale_codec/codec.rs.html#798-808 - codec::Compact::::max_encoded_len() + codec::Compact(S::get()).encoded_size() .saturating_add(Self::bound().saturating_mul(T::max_encoded_len())) } }