mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 22:35:41 +00:00
Avoid pointless work
This commit is contained in:
@@ -99,7 +99,11 @@ impl OverlayedChanges {
|
|||||||
|
|
||||||
/// Commit prospective changes to state.
|
/// Commit prospective changes to state.
|
||||||
pub fn commit_prospective(&mut self) {
|
pub fn commit_prospective(&mut self) {
|
||||||
self.committed.update(self.prospective.storage.drain());
|
if self.committed.storage.is_empty() {
|
||||||
|
::std::mem::swap(&mut self.prospective, &mut self.committed);
|
||||||
|
} else {
|
||||||
|
self.committed.update(self.prospective.storage.drain());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Drain prospective changes to an iterator.
|
/// Drain prospective changes to an iterator.
|
||||||
|
|||||||
Reference in New Issue
Block a user