Skip to content

Commit

Permalink
Use static for a logical static
Browse files Browse the repository at this point in the history
This likely has no actual performance change because LLVM will have been
lifting this to a static anyway, but it's still slightly more properly
what was intended.
  • Loading branch information
jakelishman committed Jun 11, 2024
1 parent 73aa0e9 commit 58caacb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/accelerate/src/sparse_pauli_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ fn decompose_last_level(
// an individual lookup rule, which is consumed to make an inner "loop" with a declarative macro.
macro_rules! pauli_lookup {
($name:ident, $n:literal, [$head:expr$ (, $($tail:expr),*)?]) => {
const $name: [[bool; $n]; 1<<$n] = pauli_lookup!(@acc, [$($($tail),*)?], [[false], [true]]);
static $name: [[bool; $n]; 1<<$n] = pauli_lookup!(@acc, [$($($tail),*)?], [[false], [true]]);
};
(@acc, [$head:expr $(, $($tail:expr),*)?], [$([$($bools:tt),*]),+]) => {
pauli_lookup!(@acc, [$($($tail),*)?], [$([$($bools),*, false]),+, $([$($bools),*, true]),+])
Expand Down

0 comments on commit 58caacb

Please sign in to comment.