Repository: paritytech/substrate
File: frame/system/src/lib.rs (Rust)

Code before:
		/// the prefix we are removing to accurately calculate the weight of this function.
		///
		/// # <weight>
		/// - `O(P)` where `P` amount of keys with prefix `prefix`
		/// - `P` storage deletions.
		/// - Base Weight: 0.834 * P µs
		/// - Writes: Number of subkeys + 1
		/// # </weight>
		#[pallet::weight((
			T::SystemWeightInfo::kill_prefix(_subkeys.saturating_add(1)),
			DispatchClass::Operational,
		))]
		pub(crate) fn kill_prefix(
			origin: OriginFor<T>,
			prefix: Key,
			_subkeys: u32,
		) -> DispatchResultWithPostInfo {
			ensure_root(origin)?;
			storage::unhashed::kill_prefix(&prefix);
			Ok(().into())
		}

		/// Make some on-chain remark and emit event.
		///
		/// # <weight>
		/// - `O(1)`
		/// - 1 event.
		/// # </weight>
		#[pallet::weight(T::SystemWeightInfo::remark_with_event(remark.len() as u32))]
		pub(crate) fn remark_with_event(origin: OriginFor<T>, remark: Vec<u8>) -> DispatchResultWithPostInfo {
			let who = ensure_signed(origin)?;
			let hash = T::Hashing::hash(&remark[..]);
			Self::deposit_event(Event::Remarked(who, hash));
			Ok(().into())
		}
	}

	/// Event for the System pallet.
	#[pallet::event]
	#[pallet::metadata(T::AccountId = "AccountId", T::Hash = "Hash")]
	pub enum Event<T: Config> {
		/// An extrinsic completed successfully. \[info\]
		ExtrinsicSuccess(DispatchInfo),
		/// An extrinsic failed. \[error, info\]
		ExtrinsicFailed(DispatchError, DispatchInfo),
		/// `:code` was updated.
		CodeUpdated,
		/// A new \[account\] was created.
		NewAccount(T::AccountId),
		/// An \[account\] was reaped.
		KilledAccount(T::AccountId),

Review comment (suggestion):
```suggestion
		/// - `O(b)` where b is the length of the remark.
```

Code after:
		/// the prefix we are removing to accurately calculate the weight of this function.
		///
		/// # <weight>
		/// - `O(P)` where `P` amount of keys with prefix `prefix`
		/// - `P` storage deletions.
		/// - Base Weight: 0.834 * P µs
		/// - Writes: Number of subkeys + 1
		/// # </weight>
		#[pallet::weight((
			T::SystemWeightInfo::kill_prefix(_subkeys.saturating_add(1)),
			DispatchClass::Operational,
		))]
		pub(crate) fn kill_prefix(
			origin: OriginFor<T>,
			prefix: Key,
			_subkeys: u32,
		) -> DispatchResultWithPostInfo {
			ensure_root(origin)?;
			storage::unhashed::kill_prefix(&prefix);
			Ok(().into())
		}

		/// Make some on-chain remark and emit event.
		///
		/// # <weight>
		/// - `O(b)` where b is the length of the remark.
		/// - 1 event.
		/// # </weight>
		#[pallet::weight(T::SystemWeightInfo::remark_with_event(remark.len() as u32))]
		pub(crate) fn remark_with_event(origin: OriginFor<T>, remark: Vec<u8>) -> DispatchResultWithPostInfo {
			let who = ensure_signed(origin)?;
			let hash = T::Hashing::hash(&remark[..]);
			Self::deposit_event(Event::Remarked(who, hash));
			Ok(().into())
		}
	}

	/// Event for the System pallet.
	#[pallet::event]
	#[pallet::metadata(T::AccountId = "AccountId", T::Hash = "Hash")]
	pub enum Event<T: Config> {
		/// An extrinsic completed successfully. \[info\]
		ExtrinsicSuccess(DispatchInfo),
		/// An extrinsic failed. \[error, info\]
		ExtrinsicFailed(DispatchError, DispatchInfo),
		/// `:code` was updated.
		CodeUpdated,
		/// A new \[account\] was created.
		NewAccount(T::AccountId),
		/// An \[account\] was reaped.
		KilledAccount(T::AccountId),