Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
43068f8f
Commit
43068f8f
authored
6 years ago
by
Guanqun Lu
Committed by
asynchronous rob
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
remove duplicate try_into_trie_backend (#779)
parent
caa8541a
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/core/state-machine/src/backend.rs
+1
-9
1 addition, 9 deletions
substrate/core/state-machine/src/backend.rs
with
1 addition
and
9 deletions
substrate/core/state-machine/src/backend.rs
+
1
−
9
View file @
43068f8f
...
...
@@ -117,14 +117,6 @@ impl<H, C> PartialEq for InMemory<H, C> {
}
impl
<
H
:
Hasher
,
C
:
NodeCodec
<
H
>>
InMemory
<
H
,
C
>
where
H
::
Out
:
HeapSizeOf
{
/// Try convert into trie backend.
pub
fn
try_into_trie_backend
(
self
)
->
Option
<
TrieBackend
<
MemoryDB
<
H
>
,
H
,
C
>>
{
let
mut
mdb
=
MemoryDB
::
default
();
let
root
=
insert_into_memory_db
::
<
H
,
C
,
_
>
(
&
mut
mdb
,
self
.inner
.into_iter
())
?
;
Some
(
TrieBackend
::
new
(
mdb
,
root
))
}
/// Copy the state, with applied updates
pub
fn
update
(
&
self
,
changes
:
<
Self
as
Backend
<
H
,
C
>>
::
Transaction
)
->
Self
{
let
mut
inner
:
HashMap
<
_
,
_
>
=
self
.inner
.clone
();
...
...
@@ -189,7 +181,7 @@ impl<H: Hasher, C: NodeCodec<H>> Backend<H, C> for InMemory<H, C> where H::Out:
fn
try_into_trie_backend
(
self
)
->
Option
<
TrieBackend
<
Self
::
TrieBackendStorage
,
H
,
C
>>
{
let
mut
mdb
=
MemoryDB
::
new
();
let
root
=
insert_into_memory_db
::
<
H
,
C
,
_
>
(
&
mut
mdb
,
self
.inner
.
clone
()
.
into_iter
())
?
;
let
root
=
insert_into_memory_db
::
<
H
,
C
,
_
>
(
&
mut
mdb
,
self
.inner
.into_iter
())
?
;
Some
(
TrieBackend
::
new
(
mdb
,
root
))
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment