diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/rust/neqo-qpack/src/huffman_decode_helper.rs | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/neqo-qpack/src/huffman_decode_helper.rs')
-rw-r--r-- | third_party/rust/neqo-qpack/src/huffman_decode_helper.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/third_party/rust/neqo-qpack/src/huffman_decode_helper.rs b/third_party/rust/neqo-qpack/src/huffman_decode_helper.rs index 122226dd1f..939312ab22 100644 --- a/third_party/rust/neqo-qpack/src/huffman_decode_helper.rs +++ b/third_party/rust/neqo-qpack/src/huffman_decode_helper.rs @@ -4,9 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::convert::TryFrom; - -use lazy_static::lazy_static; +use std::sync::OnceLock; use crate::huffman_table::HUFFMAN_TABLE; @@ -15,8 +13,9 @@ pub struct HuffmanDecoderNode { pub value: Option<u16>, } -lazy_static! { - pub static ref HUFFMAN_DECODE_ROOT: HuffmanDecoderNode = make_huffman_tree(0, 0); +pub fn huffman_decoder_root() -> &'static HuffmanDecoderNode { + static ROOT: OnceLock<HuffmanDecoderNode> = OnceLock::new(); + ROOT.get_or_init(|| make_huffman_tree(0, 0)) } fn make_huffman_tree(prefix: u32, len: u8) -> HuffmanDecoderNode { |