Skip to content

Commit

Permalink
fix: add const to FixedHash::zero (#5084)
Browse files Browse the repository at this point in the history
Description
---
Make `FixedHash::zero` a const fn

Motivation and Context
---
A function returning a constant value should be set as const to allow for minor compiled code optimisations. A zero hash is used more often in the DAN layer to indicate a genesis node.

How Has This Been Tested?
---
Minor change, clippy passes
  • Loading branch information
sdbondi authored Jan 10, 2023
1 parent df53843 commit 2d1bc82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base_layer/common_types/src/types/fixed_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl FixedHash {
32
}

pub fn zero() -> Self {
pub const fn zero() -> Self {
Self(ZERO_HASH)
}

Expand Down

0 comments on commit 2d1bc82

Please sign in to comment.