Skip to content
Snippets Groups Projects
Commit a935274e authored by Peter Goodspeed-Niklaus's avatar Peter Goodspeed-Niklaus Committed by GitHub
Browse files

BoundedVec MaxEncodedLen microoptimization (#8746)

parent 6eb091c7
No related merge requests found
......@@ -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()))
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment