-
Notifications
You must be signed in to change notification settings - Fork 480
Provide a StorageVec datastructure
#1995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
7b0b5ca
e05f98a
be69ee7
65d9ea6
a5e04d6
ac73b3f
ab05008
3616b6f
3013112
e29edd0
bd03135
ec4e745
63f6166
b3a564c
439f31e
45a5776
e49b846
d7abe1f
b0980af
c87ac98
afe08f0
f01d430
a0257bd
634f77c
703430a
50271bb
5c2cb4e
dc24fb9
3348363
2b15422
07e0e2b
b36ae42
f53eb73
7e161ff
b3dc029
7a12c1e
1d9b7d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Signed-off-by: Cyrill Leutwiler <[email protected]>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -206,6 +206,8 @@ where | |
| /// trigger additional storage reads. | ||
| #[inline] | ||
| pub fn len(&self) -> u32 { | ||
| debug_assert!(self.len_cached.is_none() || self.len.get() == self.len_cached); | ||
|
|
||
| self.len_cached | ||
|
||
| .unwrap_or_else(|| self.len.get().unwrap_or(u32::MIN)) | ||
| } | ||
|
|
@@ -444,6 +446,7 @@ where | |
| f.debug_struct("StorageVec") | ||
| .field("key", &KeyType::KEY) | ||
| .field("len", &self.len) | ||
ascjones marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| .field("len_cached", &self.len_cached) | ||
| .finish() | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.