pub(crate) fn clear_prefix(&mut self, prefix: &[u8]) {
		let extrinsic_index = self.extrinsic_index();

		// Iterate over all prospective and mark all keys that share
		// the given prefix as removed (None).
		for (key, entry) in self.prospective.top.iter_mut() {
			if key.starts_with(prefix) {
				entry.value = None;

				if let Some(extrinsic) = extrinsic_index {
					entry.extrinsics.get_or_insert_with(Default::default)
						.insert(extrinsic);
				}
			}
		}

		// Then do the same with keys from commited changes.
		// NOTE that we are making changes in the prospective change set.
		for key in self.committed.top.keys() {
			if key.starts_with(prefix) {
				let entry = self.prospective.top.entry(key.clone()).or_default();
				entry.value = None;

				if let Some(extrinsic) = extrinsic_index {
					entry.extrinsics.get_or_insert_with(Default::default)
						.insert(extrinsic);
				}
			}
		}
	}
/// Removes all key-value pairs which keys share the given prefix.
///
/// NOTE that this doesn't take place immediately but written into the prospective
/// change set, and still can be reverted by [`discard_prospective`].
///
/// [`discard_prospective`]: #method.discard_prospective
Removes all key-value pairs which keys share the given prefix.
NOTE that this doesn't take place immediately but written into the prospective
change set, and still can be reverted by [`discard_prospective`].


Removes all key - value pairs which keys share the given prefix . NOTE that this doesn ' t take place immediately but written into the prospective change set and still can be reverted by [ ` discard_prospective ` ] .
pub(crate) fn clear_prefix(&mut self, prefix: &[u8]) {
		let extrinsic_index = self.extrinsic_index();
		// Iterate over all prospective and mark all keys that share
		// the given prefix as removed (None).
		for (key, entry) in self.prospective.top.iter_mut() {
			if key.starts_with(prefix) {
				entry.value = None;
				if let Some(extrinsic) = extrinsic_index {
					entry.extrinsics.get_or_insert_with(Default::default)
						.insert(extrinsic);
				}
			}
		}
		// Then do the same with keys from commited changes.
		// NOTE that we are making changes in the prospective change set.
		for key in self.committed.top.keys() {
			if key.starts_with(prefix) {
				let entry = self.prospective.top.entry(key.clone()).or_default();
				entry.value = None;
				if let Some(extrinsic) = extrinsic_index {
					entry.extrinsics.get_or_insert_with(Default::default)
						.insert(extrinsic);
				}
			}
		}
	}
pub ( crate ) fn clear_prefix ( & mut self , prefix : & [ u8 ] ) { let extrinsic_index = self . extrinsic_index ( ) ; // Iterate over all prospective and mark all keys that share // the given prefix as removed (None). for ( key , entry ) in self . prospective . top . iter_mut ( ) { if key . starts_with ( prefix ) { entry . value = None ; if let Some ( extrinsic ) = extrinsic_index { entry . extrinsics . get_or_insert_with ( Default :: default ) . insert ( extrinsic ) ; } } } // Then do the same with keys from commited changes. // NOTE that we are making changes in the prospective change set. for key in self . committed . top . keys ( ) { if key . starts_with ( prefix ) { let entry = self . prospective . top . entry ( key . clone ( ) ) . or_default ( ) ; entry . value = None ; if let Some ( extrinsic ) = extrinsic_index { entry . extrinsics . get_or_insert_with ( Default :: default ) . insert ( extrinsic ) ; } } } }
Removes all key-value pairs which keys share the given prefix.
Removes all key - value pairs which keys share the given prefix .
&mut self
prefix
&[u8]
&mut self
prefix
&[u8]