Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
ink
Commits
fe3ac781
Commit
fe3ac781
authored
Jan 16, 2019
by
Hero Bird
Browse files
[pdsl_core] Remove storage::HashMap::new_unchecked
parent
44842817
Changes
1
Hide whitespace changes
Inline
Side-by-side
pdsl_core/src/storage/collections/hash_map/hash_map.rs
View file @
fe3ac781
...
...
@@ -16,7 +16,6 @@
use
crate
::
storage
::{
self
,
Key
,
chunk
::
SyncChunk
,
Setup
,
Allocator
,
...
...
@@ -102,24 +101,6 @@ impl<K, V> parity_codec::Decode for HashMap<K, V> {
}
impl
<
K
,
V
>
HashMap
<
K
,
V
>
{
/// Creates a new storage hash map for the given key.
///
/// # Safety
///
/// This is an inherently unsafe operation since it does not check
/// for the storage hash map's invariances, such as
///
/// - Is the storage region determined by the given key aliasing?
/// - Is the storage region correctly formatted to be used as storage hash map?
///
/// Users should not use this routine directly if possible.
pub
unsafe
fn
new_unchecked
(
key
:
Key
)
->
Self
{
Self
{
len
:
storage
::
Value
::
from_raw_parts
(
key
),
entries
:
SyncChunk
::
new_unchecked
(
key
+
1_u32
),
}
}
/// Allocates a new storage hash map using the given storage allocator.
///
/// # Safety
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment