mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
BoundedVec MaxEncodedLen microoptimization (#8746)
This commit is contained in:
committed by
GitHub
parent
6eb091c736
commit
a935274ef9
@@ -357,7 +357,7 @@ where
|
||||
// BoundedVec<T, S> encodes like Vec<T> 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::<u32>::max_encoded_len()
|
||||
codec::Compact(S::get()).encoded_size()
|
||||
.saturating_add(Self::bound().saturating_mul(T::max_encoded_len()))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user