From 7ecfde81506d8c8190d604fc0ed2bd1e028c437b Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 22 Sep 2020 09:51:19 +0200 Subject: [PATCH] remote_chunk_reader.rs: use Arc for cache_hint to make clone faster --- src/client/remote_chunk_reader.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/remote_chunk_reader.rs b/src/client/remote_chunk_reader.rs index 2670bf22..06f693a2 100644 --- a/src/client/remote_chunk_reader.rs +++ b/src/client/remote_chunk_reader.rs @@ -15,7 +15,7 @@ pub struct RemoteChunkReader { client: Arc, crypt_config: Option>, crypt_mode: CryptMode, - cache_hint: HashMap<[u8; 32], usize>, + cache_hint: Arc>, cache: Arc>>>, } @@ -33,7 +33,7 @@ impl RemoteChunkReader { client, crypt_config, crypt_mode, - cache_hint, + cache_hint: Arc::new(cache_hint), cache: Arc::new(Mutex::new(HashMap::new())), } } -- 2.39.2